Class: ConstantContact::Components::AccountInfo

Inherits:
Component
  • Object
show all
Defined in:
lib/constantcontact/components/account/account_info.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Constructor Details

#initializeAccountInfo

Class constructor



15
16
# File 'lib/constantcontact/components/account/account_info.rb', line 15

def initialize
end

Instance Attribute Details

#company_logoObject

Returns the value of attribute company_logo



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def 
  @company_logo
end

#country_codeObject

Returns the value of attribute country_code



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def country_code
  @country_code
end

#emailObject

Returns the value of attribute email



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def last_name
  @last_name
end

#organization_addressesObject

Returns the value of attribute organization_addresses



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def organization_addresses
  @organization_addresses
end

#organization_nameObject

Returns the value of attribute organization_name



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def organization_name
  @organization_name
end

#phoneObject

Returns the value of attribute phone



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def phone
  @phone
end

#state_codeObject

Returns the value of attribute state_code



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def state_code
  @state_code
end

#time_zoneObject

Returns the value of attribute time_zone



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def time_zone
  @time_zone
end

#websiteObject

Returns the value of attribute website



10
11
12
# File 'lib/constantcontact/components/account/account_info.rb', line 10

def website
  @website
end

Class Method Details

.create(props) ⇒ AccountInfo

Factory method to create an AccountInfo object from a json string

Parameters:

  • props (Hash)
    • properties to create object from

Returns:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/constantcontact/components/account/account_info.rb', line 21

def self.create(props)
  obj = AccountInfo.new
  if props
    props.each do |key, value|
      key = key.to_s
      if key == 'organization_addresses'
        value = value || []
        obj.organization_addresses = value.collect{|address| Components::AccountAddress.create(address) }
      else
        obj.send("#{key}=", value) if obj.respond_to? key
      end
    end
  end
  obj
end