Class: ConstantContact::Components::Address

Inherits:
Component
  • Object
show all
Defined in:
lib/constantcontact/components/contacts/address.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Instance Attribute Details

#address_typeObject

Returns the value of attribute address_type



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def address_type
  @address_type
end

#cityObject

Returns the value of attribute city



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def city
  @city
end

#country_codeObject

Returns the value of attribute country_code



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def country_code
  @country_code
end

#idObject

Returns the value of attribute id



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def id
  @id
end

#line1Object

Returns the value of attribute line1



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def line1
  @line1
end

#line2Object

Returns the value of attribute line2



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def line2
  @line2
end

#line3Object

Returns the value of attribute line3



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def line3
  @line3
end

#postal_codeObject

Returns the value of attribute postal_code



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def postal_code
  @postal_code
end

#stateObject

Returns the value of attribute state



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def state
  @state
end

#state_codeObject

Returns the value of attribute state_code



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def state_code
  @state_code
end

#sub_postal_codeObject

Returns the value of attribute sub_postal_code



10
11
12
# File 'lib/constantcontact/components/contacts/address.rb', line 10

def sub_postal_code
  @sub_postal_code
end

Class Method Details

.create(props) ⇒ Address

Factory method to create an Address object from a json string

Parameters:

  • props (Hash)
    • properties to create object from

Returns:



16
17
18
19
20
21
22
23
24
# File 'lib/constantcontact/components/contacts/address.rb', line 16

def self.create(props)
  obj = Address.new
  if props
    props.each do |key, value|
      obj.send("#{key}=", value) if obj.respond_to? key
    end
  end
  obj
end