Class: Bankscrap::Card
- Inherits:
-
Object
- Object
- Bankscrap::Card
- Includes:
- Utils::Inspectable
- Defined in:
- lib/bankscrap/card.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#avaliable ⇒ Object
Returns the value of attribute avaliable.
-
#bank ⇒ Object
Returns the value of attribute bank.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_credit ⇒ Object
Returns the value of attribute is_credit.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pan ⇒ Object
Returns the value of attribute pan.
-
#raw_data ⇒ Object
Returns the value of attribute raw_data.
Instance Method Summary collapse
- #currency ⇒ Object
-
#initialize(params = {}) ⇒ Card
constructor
A new instance of Card.
- #to_a ⇒ Object
- #to_s ⇒ Object
Methods included from Utils::Inspectable
Constructor Details
#initialize(params = {}) ⇒ Card
Returns a new instance of Card.
9 10 11 12 13 14 |
# File 'lib/bankscrap/card.rb', line 9 def initialize(params = {}) raise NotMoneyObjectError, :amount unless params[:amount].is_a?(Money) raise NotMoneyObjectError, :avaliable unless params[:avaliable].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/card.rb', line 5 def amount @amount end |
#avaliable ⇒ Object
Returns the value of attribute avaliable.
5 6 7 |
# File 'lib/bankscrap/card.rb', line 5 def avaliable @avaliable end |
#bank ⇒ Object
Returns the value of attribute bank.
5 6 7 |
# File 'lib/bankscrap/card.rb', line 5 def bank @bank end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/bankscrap/card.rb', line 5 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/bankscrap/card.rb', line 5 def id @id end |
#is_credit ⇒ Object
Returns the value of attribute is_credit.
5 6 7 |
# File 'lib/bankscrap/card.rb', line 5 def is_credit @is_credit end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/bankscrap/card.rb', line 5 def name @name end |
#pan ⇒ Object
Returns the value of attribute pan.
5 6 7 |
# File 'lib/bankscrap/card.rb', line 5 def pan @pan end |
#raw_data ⇒ Object
Returns the value of attribute raw_data.
5 6 7 |
# File 'lib/bankscrap/card.rb', line 5 def raw_data @raw_data end |
Instance Method Details
#currency ⇒ Object
16 17 18 |
# File 'lib/bankscrap/card.rb', line 16 def currency amount.try(:currency) end |
#to_a ⇒ Object
24 25 26 |
# File 'lib/bankscrap/card.rb', line 24 def to_a [id, name, description, pan, amount, avaliable, is_credit] end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/bankscrap/card.rb', line 20 def to_s description end |