Class: AuthorizeNet::Address

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/authorize_net/addresses/address.rb

Overview

Models an address.

Direct Known Subclasses

ShippingAddress

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Model

#initialize, #to_a

Instance Attribute Details

#cityObject

Returns the value of attribute city.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def city
  @city
end

#companyObject

Returns the value of attribute company.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def company
  @company
end

#countryObject

Returns the value of attribute country.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def country
  @country
end

#customer_address_idObject

Returns the value of attribute customer_address_id.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def customer_address_id
  @customer_address_id
end

#faxObject

Returns the value of attribute fax.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def fax
  @fax
end

#first_nameObject

Returns the value of attribute first_name.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def last_name
  @last_name
end

#phoneObject

Returns the value of attribute phone.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def phone
  @phone
end

#stateObject

Returns the value of attribute state.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def state
  @state
end

#street_addressObject

Returns the value of attribute street_address.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def street_address
  @street_address
end

#zipObject

Returns the value of attribute zip.



8
9
10
# File 'lib/authorize_net/addresses/address.rb', line 8

def zip
  @zip
end

Instance Method Details

#to_hashObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/authorize_net/addresses/address.rb', line 10

def to_hash
  hash = {
    :first_name => @first_name,
    :last_name => @last_name,
    :company => @company,
    :address => @street_address,
    :city => @city,
    :state => @state,
    :zip => @zip,
    :country => @country,
    :phone => @phone,
    :fax => @fax,
    :customer_address_id => @customer_address_id
  }
  hash.delete_if {|k, v| v.nil?}
end