Class: Bankscrap::Loan
- Inherits:
-
Object
- Object
- Bankscrap::Loan
- Includes:
- Utils::Inspectable
- Defined in:
- lib/bankscrap/loan.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#bank ⇒ Object
Returns the value of attribute bank.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#raw_data ⇒ Object
Returns the value of attribute raw_data.
Instance Method Summary collapse
- #currency ⇒ Object
-
#initialize(params = {}) ⇒ Loan
constructor
A new instance of Loan.
- #to_a ⇒ Object
- #to_s ⇒ Object
Methods included from Utils::Inspectable
Constructor Details
#initialize(params = {}) ⇒ Loan
Returns a new instance of Loan.
9 10 11 12 13 |
# File 'lib/bankscrap/loan.rb', line 9 def initialize(params = {}) raise NotMoneyObjectError, :amount unless params[:amount].is_a?(Money) params.each { |key, value| send "#{key}=", value } end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/bankscrap/loan.rb', line 5 def amount @amount end |
#bank ⇒ Object
Returns the value of attribute bank.
5 6 7 |
# File 'lib/bankscrap/loan.rb', line 5 def bank @bank end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/bankscrap/loan.rb', line 5 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/bankscrap/loan.rb', line 5 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/bankscrap/loan.rb', line 5 def name @name end |
#raw_data ⇒ Object
Returns the value of attribute raw_data.
5 6 7 |
# File 'lib/bankscrap/loan.rb', line 5 def raw_data @raw_data end |
Instance Method Details
#currency ⇒ Object
15 16 17 |
# File 'lib/bankscrap/loan.rb', line 15 def currency amount.try(:currency) end |
#to_a ⇒ Object
23 24 25 |
# File 'lib/bankscrap/loan.rb', line 23 def to_a [id, name, description, amount] end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/bankscrap/loan.rb', line 19 def to_s description end |