Class: Runcible::Resources::Unit
- Defined in:
- lib/runcible/resources/unit.rb
Overview
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#path(type) ⇒ String
Generates the API path for Units.
-
#search(type, criteria, optional = {}) ⇒ RestClient::Response
Searches a given unit type based on criteria.
Methods inherited from Base
#add_http_auth_header, #add_oauth_header, #call, #combine_get_params, #config, #exception_to_log, #format_payload_json, #generate_payload, #get_response, #initialize, #lazy_config=, #log_debug, #log_exception, #log_info, #logger, #process_response, #required_params
Constructor Details
This class inherits a constructor from Runcible::Base
Instance Method Details
#path(type) ⇒ String
Generates the API path for Units
9 10 11 |
# File 'lib/runcible/resources/unit.rb', line 9 def path(type) "content/units/#{type}/search/" end |
#search(type, criteria, optional = {}) ⇒ RestClient::Response
Searches a given unit type based on criteria
19 20 21 |
# File 'lib/runcible/resources/unit.rb', line 19 def search(type, criteria, optional = {}) call(:post, path(type), :payload => {:required => {:criteria => criteria}, :optional => optional}) end |