Displaying 1 result from an estimated 1 matches for "initialize_detail".
Did you mean:
initialize_details
2012 Sep 11
1
define_method vs module_eval
...METHOD, __FILE__, __LINE__ + 1
def #{name}
-ISKimRw02aC5oVgD8gxYQQ@public.gmane.org(:#{name}, [])
end
def #{name}=(value)
value = value.present? ? Array(value) : default_#{name}
_set_detail(:#{name}, value) if value != @details[:#{name}]
end
remove_possible_method :initialize_details
def initialize_details(details)
#{initialize.join("\n")}
end
METHOD
end
Here we invoke send() on the module Accessors, passing
the :define_method symbol, which represents the define_method private
method available from Class class. We create an instance method called
def...