lib/constantcontact/components/activities/activity_error.rb in constantcontact-1.0.1 vs lib/constantcontact/components/activities/activity_error.rb in constantcontact-1.0.2

- old
+ new

@@ -7,21 +7,20 @@ module ConstantContact module Components class ActivityError < Component attr_accessor :message, :line_number, :email_address - # Factory method to create an ActivityError object from an array - # @param [Hash] props - hash of properties to create object from - # @return [ActivityError] - def self.create(props) - activity_error = ActivityError.new - if props - props.each do |key, value| - activity_error.send("#{key}=", value) - end - end - activity_error - end - - end - end + # Factory method to create an ActivityError object from an array + # @param [Hash] props - hash of properties to create object from + # @return [ActivityError] + def self.create(props) + obj = ActivityError.new + if props + props.each do |key, value| + obj.send("#{key}=", value) if obj.respond_to? key + end + end + obj + end + end + end end \ No newline at end of file