Class: SynapsePay::RunTestList
- Inherits:
-
APIList
- Object
- APIResource
- APIList
- SynapsePay::RunTestList
- Defined in:
- lib/synapse_pay/nested_list.rb
Instance Attribute Summary collapse
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
Attributes inherited from APIList
Attributes inherited from APIResource
Instance Method Summary collapse
- #all(params = {}, headers = {}) ⇒ Object
-
#initialize(json = {}, api_method = nil, parent_id = nil) ⇒ RunTestList
constructor
A new instance of RunTestList.
- #refresh_from(json = {}, api_method = nil, parent_id = nil) ⇒ Object
- #retrieve(id, params = {}, headers = {}) ⇒ Object
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_id ⇒ Object
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 |