Class: ChannelAdvisor::Address
- Inherits:
-
Object
- Object
- ChannelAdvisor::Address
- Defined in:
- lib/channeladvisor/address.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#company_name ⇒ Object
Returns the value of attribute company_name.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#daytime_phone ⇒ Object
Returns the value of attribute daytime_phone.
-
#evening_phone ⇒ Object
Returns the value of attribute evening_phone.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#job_title ⇒ Object
Returns the value of attribute job_title.
-
#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.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#region ⇒ Object
Returns the value of attribute region.
-
#region_description ⇒ Object
Returns the value of attribute region_description.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #formatted ⇒ Object
- #full_name ⇒ Object
-
#initialize(attrs = {}) ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize(attrs = {}) ⇒ Address
Returns a new instance of Address.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/channeladvisor/address.rb', line 6 def initialize(attrs={}) @line1 = attrs[:address_line1] @line2 = attrs[:address_line2] @city = attrs[:city] @region = attrs[:region] @region_description = attrs[:region_description] @postal_code = attrs[:postal_code] @country_code = attrs[:country_code] @company_name = attrs[:company_name] @job_title = attrs[:job_title] @title = attrs[:title] @first_name = attrs[:first_name] @last_name = attrs[:last_name] @suffix = attrs[:suffix] @daytime_phone = attrs[:phone_number_day] @evening_phone = attrs[:phone_number_evening] end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def city @city end |
#company_name ⇒ Object
Returns the value of attribute company_name.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def company_name @company_name end |
#country_code ⇒ Object
Returns the value of attribute country_code.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def country_code @country_code end |
#daytime_phone ⇒ Object
Returns the value of attribute daytime_phone.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def daytime_phone @daytime_phone end |
#evening_phone ⇒ Object
Returns the value of attribute evening_phone.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def evening_phone @evening_phone end |
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def first_name @first_name end |
#job_title ⇒ Object
Returns the value of attribute job_title.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def job_title @job_title end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def last_name @last_name end |
#line1 ⇒ Object
Returns the value of attribute line1.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def line1 @line1 end |
#line2 ⇒ Object
Returns the value of attribute line2.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def line2 @line2 end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def postal_code @postal_code end |
#region ⇒ Object
Returns the value of attribute region.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def region @region end |
#region_description ⇒ Object
Returns the value of attribute region_description.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def region_description @region_description end |
#suffix ⇒ Object
Returns the value of attribute suffix.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def suffix @suffix end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/channeladvisor/address.rb', line 3 def title @title end |
Instance Method Details
#formatted ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/channeladvisor/address.rb', line 28 def formatted <<-EOF #{full_name} #{job_title} #{@line1} #{@line2} #{@city}, #{@region} #{@postal_code} #{@country_code} EOF end |
#full_name ⇒ Object
24 25 26 |
# File 'lib/channeladvisor/address.rb', line 24 def full_name [@title, @first_name, @last_name].join(" ") + ", #{@suffix}" end |