Title / Description
Code class MyOwnRubyClass def my_own_ruby_method(my_parameter, your_parameter) puts Time.now current_month = Time.now.month yield(my_parameter,your_parameter,current_month ) end end my_instance = MyOwnRubyClass.new my_instance.my_own_ruby_method('marcos','ricardo') { |arg1, arg2,arg3| 1.upto(arg3) do |n| ; puts "#{n.to_s} #{arg1.reverse}, #{arg2.reverse}"; end } my_instance.my_own_ruby_method('marcos','ricardo') { |arg1, arg2,arg3| 1.upto(arg3) do |n| ; puts "#{n.to_s} first value = #{arg1.size}, second value = #{arg2.size}, addition value = #{arg1.size+arg2.size}"; end }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code