# File goocanvas/lib/goocanvas.rb, line 34 def self.append_features(klass) super arity = klass.instance_method(:initialize).arity raise 'the initialize method of a class including PropsInit must have a fixed arity' if arity < 0 args_list = (1..arity).collect { |i| "param#{i}" }.join(", ") klass.module_eval alias :_initialize :initialize def initialize(#{args_list}, *args) _initialize(#{args_list}) init_props(*args) end alias :_set_property :set_property def set_property(prop_name, value) pspec = self.class.property(prop_name) value = value.to_goo if pspec.value_type.name =~ /^GooCairo/ and value.respond_to?(:to_goo) _set_property(prop_name, value) end end
Generated with the Darkfish Rdoc Generator 2.