Class: Payment::Manager::PlanParser

Inherits:
Object
  • Object
show all
Defined in:
lib/payment/manager/plan_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ PlanParser

Returns a new instance of PlanParser.



5
6
7
# File 'lib/payment/manager/plan_parser.rb', line 5

def initialize(body)
  @json = JSON.parse(body)
end

Instance Method Details

#plansObject



9
10
11
12
13
14
15
# File 'lib/payment/manager/plan_parser.rb', line 9

def plans
  @json.collect do |json|
    Payment::Manager::Plan.new(
      plan(json)
    )
  end
end