Class: BandCampBX::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/bandcampbx/mapper.rb

Instance Method Summary collapse

Constructor Details

#initializeMapper

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