Class: MollieNLIDeal::Bank

Inherits:
Object
  • Object
show all
Defined in:
lib/mollienl-ideal/bank.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values = nil) ⇒ Bank

Returns a new instance of Bank.



5
6
7
8
9
10
11
12
13
14
# File 'lib/mollienl-ideal/bank.rb', line 5

def initialize(values=nil)
  return if values.nil?

  if values.kind_of?(Hash)
    values.each { |key, value| self.send key.to_s + "=", value }
  elsif values.kind_of?(REXML::Element)
    @id = values.get_text("bank_id").to_s.to_i
    @name = values.get_text("bank_name").to_s
  end
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/mollienl-ideal/bank.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/mollienl-ideal/bank.rb', line 3

def name
  @name
end