Class: BandCampBX::Mapper
- Inherits:
-
Object
- Object
- BandCampBX::Mapper
- Defined in:
- lib/bandcampbx/mapper.rb
Instance Method Summary collapse
-
#initialize ⇒ Mapper
constructor
A new instance of Mapper.
- #map_balance(json) ⇒ Object
- #map_cancel(result) ⇒ Object
- #map_order(order) ⇒ Object
- #map_orders(json) ⇒ Object
Constructor Details
#initialize ⇒ Mapper
Returns a new instance of Mapper.
6 7 |
# File 'lib/bandcampbx/mapper.rb', line 6 def initialize end |
Instance Method Details
#map_balance(json) ⇒ Object
9 10 11 |
# File 'lib/bandcampbx/mapper.rb', line 9 def map_balance(json) Entities::Balance.new(parsed(json)) end |
#map_cancel(result) ⇒ Object
21 22 23 |
# File 'lib/bandcampbx/mapper.rb', line 21 def map_cancel(result) parsed(result) == 'true' end |
#map_order(order) ⇒ Object
17 18 19 |
# File 'lib/bandcampbx/mapper.rb', line 17 def map_order(order) Entities::Order.new(parsed(order)) end |
#map_orders(json) ⇒ Object
13 14 15 |
# File 'lib/bandcampbx/mapper.rb', line 13 def map_orders(json) parsed(json).map{|o| map_order(o) } end |