Class: Freemium::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/freemium/address.rb

Overview

eventually, this should mimic ActiveMerchant’s credit card object, with validation and errors, etc. for now it’s just a dumb (and therefore untested) data structure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Address

Returns a new instance of Address.



11
12
13
14
15
16
# File 'lib/freemium/address.rb', line 11

def initialize(options = {})
  options.each do |key, value|
    setter = "#{key}="
    self.send(setter, value) if self.respond_to? setter
  end
end

Instance Attribute Details

#address1Object Also known as: street

Returns the value of attribute address1.



5
6
7
# File 'lib/freemium/address.rb', line 5

def address1
  @address1
end

#address2Object

Returns the value of attribute address2.



5
6
7
# File 'lib/freemium/address.rb', line 5

def address2
  @address2
end

#cityObject

Returns the value of attribute city.



5
6
7
# File 'lib/freemium/address.rb', line 5

def city
  @city
end

#countryObject

Returns the value of attribute country.



5
6
7
# File 'lib/freemium/address.rb', line 5

def country
  @country
end

#emailObject

Returns the value of attribute email.



5
6
7
# File 'lib/freemium/address.rb', line 5

def email
  @email
end

#ip_addressObject

Returns the value of attribute ip_address.



5
6
7
# File 'lib/freemium/address.rb', line 5

def ip_address
  @ip_address
end

#phone_numberObject

Returns the value of attribute phone_number.



5
6
7
# File 'lib/freemium/address.rb', line 5

def phone_number
  @phone_number
end

#stateObject

Returns the value of attribute state.



5
6
7
# File 'lib/freemium/address.rb', line 5

def state
  @state
end

#zipObject

Returns the value of attribute zip.



5
6
7
# File 'lib/freemium/address.rb', line 5

def zip
  @zip
end