Class: Beanie::CustomerAddress

Inherits:
Api
  • Object
show all
Defined in:
lib/beanie/customer_address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Api

all, build_url, delete, #extract, #field_name, find, get, #object_name, #populate, post, put, #save!, set_headers

Constructor Details

#initializeCustomerAddress

Initialize instance variables



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/beanie/customer_address.rb', line 37

def initialize
  @id = nil
  @customer_id = nil
  @label = nil
  @name = nil
  @address1 = nil
  @address2 = nil
  @address3 = nil
  @city = nil
  @state_county = nil
  @zip_postcode = nil
  @country = nil
  @email = nil
  @phone = nil
  @website = nil
end

Instance Attribute Details

#address1Object

Returns the value of attribute address1.



32
33
34
# File 'lib/beanie/customer_address.rb', line 32

def address1
  @address1
end

#address2Object

Returns the value of attribute address2.



32
33
34
# File 'lib/beanie/customer_address.rb', line 32

def address2
  @address2
end

#address3Object

Returns the value of attribute address3.



32
33
34
# File 'lib/beanie/customer_address.rb', line 32

def address3
  @address3
end

#cityObject

Returns the value of attribute city.



32
33
34
# File 'lib/beanie/customer_address.rb', line 32

def city
  @city
end

#country_idObject

Returns the value of attribute country_id.



33
34
35
# File 'lib/beanie/customer_address.rb', line 33

def country_id
  @country_id
end

#customer_idObject

Returns the value of attribute customer_id.



32
33
34
# File 'lib/beanie/customer_address.rb', line 32

def customer_id
  @customer_id
end

#emailObject

Returns the value of attribute email.



33
34
35
# File 'lib/beanie/customer_address.rb', line 33

def email
  @email
end

#idObject

Returns the value of attribute id.



32
33
34
# File 'lib/beanie/customer_address.rb', line 32

def id
  @id
end

#labelObject

Returns the value of attribute label.



32
33
34
# File 'lib/beanie/customer_address.rb', line 32

def label
  @label
end

#nameObject

Returns the value of attribute name.



32
33
34
# File 'lib/beanie/customer_address.rb', line 32

def name
  @name
end

#phoneObject

Returns the value of attribute phone.



33
34
35
# File 'lib/beanie/customer_address.rb', line 33

def phone
  @phone
end

#state_countyObject

Returns the value of attribute state_county.



33
34
35
# File 'lib/beanie/customer_address.rb', line 33

def state_county
  @state_county
end

#websiteObject

Returns the value of attribute website.



33
34
35
# File 'lib/beanie/customer_address.rb', line 33

def website
  @website
end

#zip_postcodeObject

Returns the value of attribute zip_postcode.



33
34
35
# File 'lib/beanie/customer_address.rb', line 33

def zip_postcode
  @zip_postcode
end

Instance Method Details

#construct_path(opts = {}) ⇒ Object

Construct the path a little differently…



56
57
58
59
60
61
# File 'lib/beanie/customer_address.rb', line 56

def construct_path(opts = {})
  raise ":customer_id is not defined" unless opts[:customer_id]
  path = "/customers/#{opts[:customer_id]}/customer_addresses"
  opts.delete(:customer_id)
  path
end