Class: Omise::RefundList

Inherits:
List show all
Defined in:
lib/omise/refund_list.rb

Instance Method Summary collapse

Methods inherited from List

#each, #last, #reload, #to_a

Methods inherited from OmiseObject

location, resource

Methods included from Attributes

#[], #as_json, #assign_attributes, #attributes, #destroyed?, #key?, #location, #method_missing, #respond_to?

Constructor Details

#initialize(charge, attributes = {}) ⇒ RefundList

Returns a new instance of RefundList.



6
7
8
9
# File 'lib/omise/refund_list.rb', line 6

def initialize(charge, attributes = {})
  super(attributes)
  @charge = charge
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Omise::Attributes

Instance Method Details

#create(attributes = {}) ⇒ Object



11
12
13
# File 'lib/omise/refund_list.rb', line 11

def create(attributes = {})
  Refund.new self.class.resource(location, attributes).post(attributes)
end

#retrieve(id, attributes = {}) ⇒ Object



15
16
17
# File 'lib/omise/refund_list.rb', line 15

def retrieve(id, attributes = {})
  Refund.new self.class.resource(location(id), attributes).get
end