Class: Dhl::Intraship::Bankdata

Inherits:
Object
  • Object
show all
Defined in:
lib/dhl-intraship/bankdata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Bankdata

Returns a new instance of Bankdata.



6
7
8
9
10
11
12
13
# File 'lib/dhl-intraship/bankdata.rb', line 6

def initialize(attributes = {})
  attributes.each do |key, value|
    setter = :"#{key.to_s}="
    if self.respond_to?(setter)
      self.send(setter, value)
    end
  end
end

Instance Attribute Details

#account_numberObject

Returns the value of attribute account_number.



4
5
6
# File 'lib/dhl-intraship/bankdata.rb', line 4

def 
  @account_number
end

#bank_codeObject

Returns the value of attribute bank_code.



4
5
6
# File 'lib/dhl-intraship/bankdata.rb', line 4

def bank_code
  @bank_code
end

#bank_nameObject

Returns the value of attribute bank_name.



4
5
6
# File 'lib/dhl-intraship/bankdata.rb', line 4

def bank_name
  @bank_name
end

#bicObject

Returns the value of attribute bic.



4
5
6
# File 'lib/dhl-intraship/bankdata.rb', line 4

def bic
  @bic
end

#ibanObject

Returns the value of attribute iban.



4
5
6
# File 'lib/dhl-intraship/bankdata.rb', line 4

def iban
  @iban
end

#noteObject

Returns the value of attribute note.



4
5
6
# File 'lib/dhl-intraship/bankdata.rb', line 4

def note
  @note
end

#ownerObject

Returns the value of attribute owner.



4
5
6
# File 'lib/dhl-intraship/bankdata.rb', line 4

def owner
  @owner
end

Instance Method Details

#append_to_xml(xml) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/dhl-intraship/bankdata.rb', line 15

def append_to_xml(xml)
  xml.BankData do |xml|
    xml.cis(:accountOwner, owner)
    xml.cis(:accountNumber, ) unless .blank?
    xml.cis(:bankCode, bank_code) unless bank_code.blank?
    xml.cis(:bankName, bank_name) unless bank_name.blank?
    xml.cis(:iban, iban) unless iban.blank?
    xml.cis(:note, note) unless note.blank?
    xml.cis(:bic, bic) unless bic.blank?
  end
end