Class: RubyPsigate::Address
- Inherits:
-
Object
- Object
- RubyPsigate::Address
- Includes:
- HashVariables
- Defined in:
- lib/ruby_psigate/address.rb
Overview
DOC - TODO
Instance Attribute Summary collapse
-
#city ⇒ Object
(also: #bcity, #scity)
Returns the value of attribute city.
-
#company ⇒ Object
(also: #bcompany, #scompany)
Returns the value of attribute company.
-
#country ⇒ Object
(also: #bcountry, #scountry)
Returns the value of attribute country.
-
#fax ⇒ Object
Returns the value of attribute fax.
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
-
#line1 ⇒ Object
(also: #address1)
Returns the value of attribute line1.
-
#line2 ⇒ Object
(also: #address2)
Returns the value of attribute line2.
-
#state ⇒ Object
(also: #province)
Returns the value of attribute state.
-
#telephone ⇒ Object
(also: #phone)
Returns the value of attribute telephone.
-
#zipcode ⇒ Object
(also: #postalcode)
Returns the value of attribute zipcode.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Address
constructor
A new instance of Address.
- #name ⇒ Object (also: #bname, #sname)
- #to_hash(type = nil) ⇒ Object
Methods included from HashVariables
Constructor Details
#initialize(options = {}) ⇒ Address
Returns a new instance of Address.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ruby_psigate/address.rb', line 24 def initialize(={}) @firstname = [:firstname] @lastname = [:lastname] @line1 = [:line1] @line2 = [:line2] @city = [:city] @state = [:state] @country = [:country] @zipcode = [:zipcode] @telephone = [:telephone] @fax = [:fax] @company = [:company] super end |
Instance Attribute Details
#city ⇒ Object Also known as: bcity, scity
Returns the value of attribute city.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def city @city end |
#company ⇒ Object Also known as: bcompany, scompany
Returns the value of attribute company.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def company @company end |
#country ⇒ Object Also known as: bcountry, scountry
Returns the value of attribute country.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def country @country end |
#fax ⇒ Object
Returns the value of attribute fax.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def fax @fax end |
#firstname ⇒ Object
Returns the value of attribute firstname.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def firstname @firstname end |
#lastname ⇒ Object
Returns the value of attribute lastname.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def lastname @lastname end |
#line1 ⇒ Object Also known as: address1
Returns the value of attribute line1.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def line1 @line1 end |
#line2 ⇒ Object Also known as: address2
Returns the value of attribute line2.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def line2 @line2 end |
#state ⇒ Object Also known as: province
Returns the value of attribute state.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def state @state end |
#telephone ⇒ Object Also known as: phone
Returns the value of attribute telephone.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def telephone @telephone end |
#zipcode ⇒ Object Also known as: postalcode
Returns the value of attribute zipcode.
11 12 13 |
# File 'lib/ruby_psigate/address.rb', line 11 def zipcode @zipcode end |
Instance Method Details
#name ⇒ Object Also known as: bname, sname
39 40 41 |
# File 'lib/ruby_psigate/address.rb', line 39 def name "#{firstname} #{lastname}".strip end |
#to_hash(type = nil) ⇒ Object
43 44 45 46 47 |
# File 'lib/ruby_psigate/address.rb', line 43 def to_hash(type = nil) result = super result = result.delete_if { |key, value| value.nil? } # Delete empty hash values result end |