Class: SynapsePay::RunTestList

Inherits:
APIList show all
Defined in:
lib/synapse_pay/nested_list.rb

Instance Attribute Summary collapse

Attributes inherited from APIList

#client, #data, #klass

Attributes inherited from APIResource

#api_method, #client, #json

Instance Method Summary collapse

Methods inherited from APIList

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

Methods inherited from APIResource

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, register_api_subclass, #to_json

Constructor Details

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

Returns a new instance of RunTestList.



5
6
7
# File 'lib/synapse_pay/nested_list.rb', line 5

def initialize(json={}, api_method=nil, parent_id=nil)
  refresh_from(json, api_method, parent_id)
end

Instance Attribute Details

#parent_idObject

Returns the value of attribute parent_id.



3
4
5
# File 'lib/synapse_pay/nested_list.rb', line 3

def parent_id
  @parent_id
end

Instance Method Details

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



15
16
17
18
# File 'lib/synapse_pay/nested_list.rb', line 15

def all(params={}, headers={})
  method = APIMethod.new(:get, "/runs/:parent_id/tests", params, headers, self)
  self.refresh_from(method.execute, method, parent_id)
end

#refresh_from(json = {}, api_method = nil, parent_id = nil) ⇒ Object



9
10
11
12
13
# File 'lib/synapse_pay/nested_list.rb', line 9

def refresh_from(json={}, api_method=nil, parent_id=nil)
  @klass = Util.constantize(:Test)
  @parent_id = parent_id || @parent_id
  super(json, api_method)
end

#retrieve(id, params = {}, headers = {}) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/synapse_pay/nested_list.rb', line 20

def retrieve(id, params={}, headers={})
  params = ParamsBuilder.merge(params, {
    :id => id,
  })
  method = APIMethod.new(:get, "/runs/:parent_id/tests/:id", params, headers, self)
  Util.constantize(:Test).new(method.execute, method)
end