assets/src/ruboto/widget.rb in ruboto-1.0.2 vs assets/src/ruboto/widget.rb in ruboto-1.0.3
- old
+ new
@@ -74,10 +74,13 @@
invoke_with_converted_arguments(lp, method_name, v)
end
end
params.each do |k, v|
- method_name = self.respond_to?("#{k}=") ? "#{k}=" : k
+ setter_method = "set#{k.to_s.gsub(/(^|_)([a-z])/) { $2.upcase }}"
+ assign_method = "#{k}="
+ method_name = self.respond_to?(assign_method) ? assign_method :
+ (self.respond_to?(setter_method) ? setter_method : k)
invoke_with_converted_arguments(self, method_name, v)
end
end
end