Class: CiPower::Address

Inherits:
Record
  • Object
show all
Defined in:
lib/ci_power/address.rb

Instance Attribute Summary collapse

Attributes inherited from Record

#address_identification_debtee, #address_identification_debtor, #group_no, #record_type

Instance Method Summary collapse

Methods inherited from Record

#cip_default_data, #fill_up, #line_terminator

Constructor Details

#initialize(attributes = {}) ⇒ Address

Returns a new instance of Address.



43
44
45
46
47
48
49
50
# File 'lib/ci_power/address.rb', line 43

def initialize(attributes = {})
  if attributes.is_a? Hash
    attributes.merge! :record_type => '01'
    attributes.each do |key, value|
      self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
    end
  end
end

Instance Attribute Details

#account_noObject

Returns the value of attribute account_no.



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

def 
  @account_no
end

#addressObject

Returns the value of attribute address.



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

def address
  @address
end

#address_type_companyObject

Returns the value of attribute address_type_company.



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

def address_type_company
  @address_type_company
end

#cityObject

Returns the value of attribute city.



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

def city
  @city
end

#commercial_register_noObject

Returns the value of attribute commercial_register_no.



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

def commercial_register_no
  @commercial_register_no
end

#contact_firstnameObject

Returns the value of attribute contact_firstname.



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

def contact_firstname
  @contact_firstname
end

#contact_lastnameObject

Returns the value of attribute contact_lastname.



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

def contact_lastname
  @contact_lastname
end

#contact_salutationObject

Returns the value of attribute contact_salutation.



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

def contact_salutation
  @contact_salutation
end

#countryObject

Returns the value of attribute country.



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

def country
  @country
end

#customer_specific_field_1Object

Returns the value of attribute customer_specific_field_1.



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

def customer_specific_field_1
  @customer_specific_field_1
end

#customer_specific_field_10Object

Returns the value of attribute customer_specific_field_10.



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

def customer_specific_field_10
  @customer_specific_field_10
end

#customer_specific_field_11Object

Returns the value of attribute customer_specific_field_11.



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

def customer_specific_field_11
  @customer_specific_field_11
end

#customer_specific_field_12Object

Returns the value of attribute customer_specific_field_12.



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

def customer_specific_field_12
  @customer_specific_field_12
end

#customer_specific_field_13Object

Returns the value of attribute customer_specific_field_13.



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

def customer_specific_field_13
  @customer_specific_field_13
end

#customer_specific_field_14Object

Returns the value of attribute customer_specific_field_14.



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

def customer_specific_field_14
  @customer_specific_field_14
end

#customer_specific_field_15Object

Returns the value of attribute customer_specific_field_15.



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

def customer_specific_field_15
  @customer_specific_field_15
end

#customer_specific_field_16Object

Returns the value of attribute customer_specific_field_16.



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

def customer_specific_field_16
  @customer_specific_field_16
end

#customer_specific_field_2Object

Returns the value of attribute customer_specific_field_2.



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

def customer_specific_field_2
  @customer_specific_field_2
end

#customer_specific_field_3Object

Returns the value of attribute customer_specific_field_3.



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

def customer_specific_field_3
  @customer_specific_field_3
end

#customer_specific_field_4Object

Returns the value of attribute customer_specific_field_4.



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

def customer_specific_field_4
  @customer_specific_field_4
end

#customer_specific_field_5Object

Returns the value of attribute customer_specific_field_5.



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

def customer_specific_field_5
  @customer_specific_field_5
end

#customer_specific_field_6Object

Returns the value of attribute customer_specific_field_6.



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

def customer_specific_field_6
  @customer_specific_field_6
end

#customer_specific_field_7Object

Returns the value of attribute customer_specific_field_7.



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

def customer_specific_field_7
  @customer_specific_field_7
end

#customer_specific_field_8Object

Returns the value of attribute customer_specific_field_8.



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

def customer_specific_field_8
  @customer_specific_field_8
end

#customer_specific_field_9Object

Returns the value of attribute customer_specific_field_9.



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

def customer_specific_field_9
  @customer_specific_field_9
end

#firstnameObject

Returns the value of attribute firstname.



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

def firstname
  @firstname
end

#industryObject

Returns the value of attribute industry.



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

def industry
  @industry
end

#languageObject

Returns the value of attribute language.



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

def language
  @language
end

#lastnameObject

Returns the value of attribute lastname.



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

def lastname
  @lastname
end

#method_of_paymentObject

Returns the value of attribute method_of_payment.



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

def method_of_payment
  @method_of_payment
end

#name_affixObject

Returns the value of attribute name_affix.



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

def name_affix
  @name_affix
end

#new_order_idObject

Returns the value of attribute new_order_id.



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

def new_order_id
  @new_order_id
end

#po_boxObject

Returns the value of attribute po_box.



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

def po_box
  @po_box
end

#postal_codeObject

Returns the value of attribute postal_code.



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

def postal_code
  @postal_code
end

#regionObject

Returns the value of attribute region.



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

def region
  @region
end

#reserve_fieldObject

Returns the value of attribute reserve_field.



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

def reserve_field
  @reserve_field
end

#salutationObject

Returns the value of attribute salutation.



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

def salutation
  @salutation
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#vat_noObject

Returns the value of attribute vat_no.



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

def vat_no
  @vat_no
end

Instance Method Details

#to_cip(with_line_terminator = true) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/ci_power/address.rb', line 52

def to_cip(with_line_terminator = true)
  cip_default_data << fill_up(
    {
      :address_type_company => 1,
      :title => 32,
      :salutation =>  10,
      :lastname => 32,
      :firstname => 32,
      :name_affix => 32,
      :address => 32,
      :po_box => 32,
      :postal_code => 10,
      :city => 32,
      :country => 10,
      :contact_salutation => 10,
      :contact_lastname => 32,
      :contact_firstname => 32,
      :language => 10,
      :method_of_payment => 10,
      :account_no => 32,
      :commercial_register_no => 15,
      :vat_no => 15,
      :industry => 10,
      :region => 10,
      :reserve_field => 10,
      :customer_specific_field_1 => 10,
      :customer_specific_field_2 => 10,
      :customer_specific_field_3 => 10,
      :customer_specific_field_4 => 32,
      :customer_specific_field_5 => 32,
      :customer_specific_field_6 => 64,
      :customer_specific_field_7 => 64,
      :customer_specific_field_8 => 64,
      :customer_specific_field_9 => 64,
      :customer_specific_field_10 => 64,
      :customer_specific_field_11 => 64,
      :customer_specific_field_12 => 64,
      :customer_specific_field_13 => 64,
      :customer_specific_field_14 => 64,
      :customer_specific_field_15 => 64,
      :customer_specific_field_16 => 64
    }, with_line_terminator
  )
end