Class: Moip2::RefundApi

Inherits:
Object
  • Object
show all
Defined in:
lib/moip2/refund_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ RefundApi

Returns a new instance of RefundApi.



5
6
7
# File 'lib/moip2/refund_api.rb', line 5

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'lib/moip2/refund_api.rb', line 3

def client
  @client
end

Instance Method Details

#base_path(id) ⇒ Object



9
10
11
# File 'lib/moip2/refund_api.rb', line 9

def base_path(id)
  "/v2/#{base_resource(id)}/#{id}/refunds"
end

#create(id, refund = {}) ⇒ Object



13
14
15
# File 'lib/moip2/refund_api.rb', line 13

def create(id, refund = {})
  Resource::Refund.new client, client.post(base_path(id), refund)
end

#show(id) ⇒ Object



17
18
19
# File 'lib/moip2/refund_api.rb', line 17

def show(id)
  Resource::Refund.new client, client.get("/v2/refunds/#{id}")
end