Class: RubyPsigate::Address

Inherits:
Object
  • Object
show all
Includes:
HashVariables
Defined in:
lib/ruby_psigate/address.rb

Overview

DOC - TODO

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashVariables

included

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(options={})
  @firstname  = options[:firstname]
  @lastname   = options[:lastname]
  @line1      = options[:line1]
  @line2      = options[:line2]
  @city       = options[:city]
  @state      = options[:state]
  @country    = options[:country]
  @zipcode    = options[:zipcode]
  @telephone  = options[:telephone]
  @fax        = options[:fax]
  @company    = options[:company]
  super
end

Instance Attribute Details

#cityObject 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

#companyObject 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

#countryObject 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

#faxObject

Returns the value of attribute fax.



11
12
13
# File 'lib/ruby_psigate/address.rb', line 11

def fax
  @fax
end

#firstnameObject

Returns the value of attribute firstname.



11
12
13
# File 'lib/ruby_psigate/address.rb', line 11

def firstname
  @firstname
end

#lastnameObject

Returns the value of attribute lastname.



11
12
13
# File 'lib/ruby_psigate/address.rb', line 11

def lastname
  @lastname
end

#line1Object 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

#line2Object 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

#stateObject 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

#telephoneObject 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

#zipcodeObject 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

#nameObject 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