lib/constantcontact/components/tracking/forward_activity.rb in constantcontact-1.0.1 vs lib/constantcontact/components/tracking/forward_activity.rb in constantcontact-1.0.2
- old
+ new
@@ -7,22 +7,20 @@
module ConstantContact
module Components
class ForwardActivity < Component
attr_accessor :activity_type, :campaign_id, :contact_id, :email_address, :forward_date
-
- # Factory method to create a ForwardActivity object from an array
- # @param [Hash] props - hash of properties to create object from
- # @return [ForwardActivity]
- def self.create(props)
- forward_activity = ForwardActivity.new
- if props
- props.each do |key, value|
- forward_activity.send("#{key}=", value)
- end
- end
- forward_activity
- end
-
- end
- end
+ # Factory method to create a ForwardActivity object from an array
+ # @param [Hash] props - hash of properties to create object from
+ # @return [ForwardActivity]
+ def self.create(props)
+ obj = ForwardActivity.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