lib/moip-assinaturas/plan.rb in moip-assinaturas-0.0.2 vs lib/moip-assinaturas/plan.rb in moip-assinaturas-0.0.3
- old
+ new
@@ -3,14 +3,14 @@
class << self
def create(plan)
response = Moip::Assinaturas::Client.create_plan(plan)
+ hash = JSON.load(response.body).with_indifferent_access
case response.code
when 201
- hash = JSON.load(response.body).with_indifferent_access
return {
success: true,
plan: hash
}
when 400
@@ -24,14 +24,14 @@
end
end
def list
response = Moip::Assinaturas::Client.list_plans
+ hash = JSON.load(response.body).with_indifferent_access
case response.code
when 200
- hash = JSON.load(response.body).with_indifferent_access
return {
success: true,
plans: hash[:plans]
}
else
@@ -39,13 +39,13 @@
end
end
def details(code)
response = Moip::Assinaturas::Client.details_plan(code)
+ hash = JSON.load(response.body).with_indifferent_access
case response.code
when 200
- hash = JSON.load(response.body).with_indifferent_access
return {
success: true,
plan: hash
}
else
\ No newline at end of file