Class: Supai::Address
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#line1 ⇒ Object
Returns the value of attribute line1.
-
#line2 ⇒ Object
Returns the value of attribute line2.
-
#line3 ⇒ Object
Returns the value of attribute line3.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#region_code ⇒ Object
Returns the value of attribute region_code.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Address
constructor
A new instance of Address.
- #inspect ⇒ Object
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
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/supai/address.rb', line 3 def city @city end |
#country_code ⇒ Object
Returns the value of attribute country_code.
3 4 5 |
# File 'lib/supai/address.rb', line 3 def country_code @country_code end |
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/supai/address.rb', line 3 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/supai/address.rb', line 3 def last_name @last_name end |
#line1 ⇒ Object
Returns the value of attribute line1.
3 4 5 |
# File 'lib/supai/address.rb', line 3 def line1 @line1 end |
#line2 ⇒ Object
Returns the value of attribute line2.
3 4 5 |
# File 'lib/supai/address.rb', line 3 def line2 @line2 end |
#line3 ⇒ Object
Returns the value of attribute line3.
3 4 5 |
# File 'lib/supai/address.rb', line 3 def line3 @line3 end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
3 4 5 |
# File 'lib/supai/address.rb', line 3 def postal_code @postal_code end |
#region_code ⇒ Object
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
#inspect ⇒ Object
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 |