Class: ConstantContact::Components::Activity
- Defined in:
- lib/constantcontact/components/activities/activity.rb
Instance Attribute Summary collapse
-
#contact_count ⇒ Object
Returns the value of attribute contact_count.
-
#created_date ⇒ Object
Returns the value of attribute created_date.
-
#error_count ⇒ Object
Returns the value of attribute error_count.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#finish_date ⇒ Object
Returns the value of attribute finish_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#type ⇒ Object
Returns the value of attribute type.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Class Method Summary collapse
-
.create(props) ⇒ Activity
Factory method to create an Activity object from a json string.
Methods inherited from Component
#to_hash, to_hash_value, #to_json
Instance Attribute Details
#contact_count ⇒ Object
Returns the value of attribute contact_count
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def contact_count @contact_count end |
#created_date ⇒ Object
Returns the value of attribute created_date
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def created_date @created_date end |
#error_count ⇒ Object
Returns the value of attribute error_count
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def error_count @error_count end |
#errors ⇒ Object
Returns the value of attribute errors
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def errors @errors end |
#file_name ⇒ Object
Returns the value of attribute file_name
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def file_name @file_name end |
#finish_date ⇒ Object
Returns the value of attribute finish_date
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def finish_date @finish_date end |
#id ⇒ Object
Returns the value of attribute id
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def id @id end |
#start_date ⇒ Object
Returns the value of attribute start_date
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def start_date @start_date end |
#status ⇒ Object
Returns the value of attribute status
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def status @status end |
#type ⇒ Object
Returns the value of attribute type
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def type @type end |
#warnings ⇒ Object
Returns the value of attribute warnings
10 11 12 |
# File 'lib/constantcontact/components/activities/activity.rb', line 10 def warnings @warnings end |
Class Method Details
.create(props) ⇒ Activity
Factory method to create an Activity object from a json string
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/constantcontact/components/activities/activity.rb', line 16 def self.create(props) obj = Activity.new if props props.each do |key, value| if key == 'errors' if value obj.errors = [] value.each do |error| obj.errors << Components::ActivityError.create(error) end end elsif key == 'warnings' if value obj.warnings = [] value.each do |error| obj.warnings << Components::ActivityError.create(error) end end else obj.send("#{key}=", value) if obj.respond_to? key end end end obj end |