How can I do what they are talking about here, but in Ruby?
How would you do the function on an object? and how would you do a global function (see jetxee's answer on the post mentioned)?
EXAMPLE CODE:
event_name = "load"
def load()
puts "load() function was executed."
end
def row_changed()
puts "row_changed() function was executed."
end
#something here to see that event_name = "load" and run load()
UPDATE:
How do you get to the global methods? or my global functions?
I tried this additional line
puts methods
and load and row_change where not listed.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…