Class: Paid::RefundList

Inherits:
APIList show all
Defined in:
lib/paid/refund_list.rb

Instance Attribute Summary collapse

Attributes inherited from APIList

#data, #klass

Attributes inherited from APIResource

#api_method, #json

Instance Method Summary collapse

Methods inherited from APIList

#[], #[]=, #each, #inspect, #inspect_data, #last, #length, #refresh_from

Methods inherited from APIResource

add_api_attribute, api_attribute_names, #api_attributes, api_subclass_fetch, api_subclasses, #changed_api_attributes, #clear_api_attributes, #determine_api_attribute_value, determine_api_attribute_value, #inspect, #inspect_api_attributes, #inspect_nested, #refresh_from, register_api_subclass, #to_json

Constructor Details

#initialize(json = {}, api_method = nil, parent_id = nil) ⇒ RefundList

Returns a new instance of RefundList.



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

def initialize(json={}, api_method=nil, parent_id=nil)
  @klass = Util.constantize(:Transaction)
  @parent_id = parent_id
  refresh_from(json, api_method)
end

Instance Attribute Details

#parent_idObject

Returns the value of attribute parent_id.



3
4
5
# File 'lib/paid/refund_list.rb', line 3

def parent_id
  @parent_id
end

Instance Method Details

#create(params = {}, headers = {}) ⇒ Object

Not live on the server yet. def all(params={}, headers={})

method = APIMethod.new(:get, "/transactions/:parent_id/refunds", params, headers, self)
APIList.new(:Transaction, method.execute, method)

end



17
18
19
20
# File 'lib/paid/refund_list.rb', line 17

def create(params={}, headers={})
  method = APIMethod.new(:post, "/transactions/:parent_id/refunds", params, headers, self)
  Util.constantize(:Transaction).new(method.execute, method)
end