hi jjs,
I have the Pragmatic Programmers Guide for Ruby (1.9) and tbh I think its an amazing book for learning!
Ok, ok its not a quick guide, the opposite in fact BUT once you have an understanding of the concepts of Ruby its a great resource! (dont go too far in it though)
Trog mentioned Why's poignant guide, I think its a very enjoyable text worth a read. Not advanced but worthy of a read to understand the aims of programming in Ruby.
Ruby is a very forgiving language to write with (in my opinion).Not much control/structural syntax.
It does get easier trust me and your method for outputting data is correct. ie.
output "hello"
the ins and outs are arrays (if you have more than 1 in/out) and are indexed accordingly.
so lets say you create a ruby module with 5 ins & 5 outs.
To access the inputs:
@ins = input array ( whole array ) - use to access whole array
@ins[0] =
input at index 0 in array@ins[1] =
input at index 1 in array@ins[2] =
input at index 2 in array@ins[3] =
input at index 3 in array. . . . and so onEG: (take third input and multiply by 6.75)myvar = @ins[2] * 6.75 Outputs:
output 0,x =
output x at first outputoutput 1,x =
output x at second outputoutput 2,x =
output x at third outputoutput 3,x =
output x at fourth output . . . . and so onEG: (output myvar to first output)output 0,myvarIts worth reading the FS user guide's examples and documentation on ruby.
From my experience, I would start by learning all the data types in ruby first, ie arrays, strings, hashes, numbers ect.
That way when you do real application design you understand how to move the data in and out of ruby and how she
handles the data.Ive spent hours trying to send string arrays of floats to a ruby module for parsing. . . . couple of hours wasted to reveal a simple solution. string.split
Damn
It does exactly what is says , splits the string . . . . doh!
Then move to control statements, classes and blocks ect.
You should pick it up quick, duck-typing is a blessing here lol!
Hope this helps