Class: CiPower::Action

Inherits:
Record
  • Object
show all
Defined in:
lib/ci_power/action.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 = {}) ⇒ Action

Returns a new instance of Action.



26
27
28
29
30
31
32
33
# File 'lib/ci_power/action.rb', line 26

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

Instance Attribute Details

#actionObject

Returns the value of attribute action.



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

def action
  @action
end

#action_dateObject

Returns the value of attribute action_date.



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

def action_date
  @action_date
end

#amountObject

Returns the value of attribute amount.



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

def amount
  @amount
end

#cip_dossier_noObject

Returns the value of attribute cip_dossier_no.



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

def cip_dossier_no
  @cip_dossier_no
end

#cip_identificationObject

Returns the value of attribute cip_identification.



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

def cip_identification
  @cip_identification
end

#comment_1Object

Returns the value of attribute comment_1.



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

def comment_1
  @comment_1
end

#comment_2Object

Returns the value of attribute comment_2.



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

def comment_2
  @comment_2
end

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#customer_specific_field_1Object

Returns the value of attribute customer_specific_field_1.



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

def customer_specific_field_1
  @customer_specific_field_1
end

#customer_specific_field_2Object

Returns the value of attribute customer_specific_field_2.



3
4
5
# File 'lib/ci_power/action.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/action.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/action.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/action.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/action.rb', line 3

def customer_specific_field_6
  @customer_specific_field_6
end

#debt_claim_groupObject

Returns the value of attribute debt_claim_group.



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

def debt_claim_group
  @debt_claim_group
end

#exchange_rateObject

Returns the value of attribute exchange_rate.



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

def exchange_rate
  @exchange_rate
end

#external_dossier_noObject

Returns the value of attribute external_dossier_no.



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

def external_dossier_no
  @external_dossier_no
end

#internal_noteObject

Returns the value of attribute internal_note.



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

def internal_note
  @internal_note
end

#mkzObject

Returns the value of attribute mkz.



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

def mkz
  @mkz
end

#op_membershipObject

Returns the value of attribute op_membership.



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

def op_membership
  @op_membership
end

#op_noObject

Returns the value of attribute op_no.



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

def op_no
  @op_no
end

#value_dateObject

Returns the value of attribute value_date.



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

def value_date
  @value_date
end

Instance Method Details

#to_cip(with_line_terminator = true) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/ci_power/action.rb', line 35

def to_cip(with_line_terminator = true)
  cip_default_data << fill_up(
    {
      :action_date => 10,
      :action => 10,
      :mkz => 10,
      :amount => 15,
      :currency => 10,
      :exchange_rate => 15,
      :value_date => 10,
      :comment_1 => 32,
      :comment_2 => 32,
      :op_no => 32,
      :op_membership => 32,
      :cip_dossier_no => 25,
      :external_dossier_no => 32,
      :cip_identification => 7,
      :debt_claim_group => 32,
      :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 => 42,
      :internal_note => 1500
    }, with_line_terminator
  )
end