Class: Supai::Address

Inherits:
Resource show all
Defined in:
lib/supai/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#as_json, attr_accessor, attr_collections, attr_objects, attr_timestamp_accessor, attributes, #parse_collection, #parse_object, #parse_timestamp, #set_attribute, #set_attributes, #underscore

Constructor Details

#initialize(hash) ⇒ Address

Returns a new instance of Address.



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

def initialize(hash)
  set_attributes(hash)
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



3
4
5
# File 'lib/supai/address.rb', line 3

def city
  @city
end

#country_codeObject

Returns the value of attribute country_code.



3
4
5
# File 'lib/supai/address.rb', line 3

def country_code
  @country_code
end

#first_nameObject

Returns the value of attribute first_name.



3
4
5
# File 'lib/supai/address.rb', line 3

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



3
4
5
# File 'lib/supai/address.rb', line 3

def last_name
  @last_name
end

#line1Object

Returns the value of attribute line1.



3
4
5
# File 'lib/supai/address.rb', line 3

def line1
  @line1
end

#line2Object

Returns the value of attribute line2.



3
4
5
# File 'lib/supai/address.rb', line 3

def line2
  @line2
end

#line3Object

Returns the value of attribute line3.



3
4
5
# File 'lib/supai/address.rb', line 3

def line3
  @line3
end

#postal_codeObject

Returns the value of attribute postal_code.



3
4
5
# File 'lib/supai/address.rb', line 3

def postal_code
  @postal_code
end

#region_codeObject

Returns the value of attribute region_code.



3
4
5
# File 'lib/supai/address.rb', line 3

def region_code
  @region_code
end

Instance Method Details

#inspectObject



12
13
14
15
16
17
# File 'lib/supai/address.rb', line 12

def inspect
  display = [line1, line2, line3, city, region_code, country_code].select { |str|
    str.length > 0
  }.join(", ")
  "#<#{self.class} #{display}>"
end