Class: Runcible::Resources::Unit
- Defined in:
- lib/runcible/resources/unit.rb
Overview
Direct Known Subclasses
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, #format_payload_json, #generate_log_message, #generate_payload, #get_response, #initialize, #lazy_config=, #log_debug, #log_exception, #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
34 35 36 |
# File 'lib/runcible/resources/unit.rb', line 34 def path(type) "content/units/#{type}/search/" end |
#search(type, criteria, optional = {}) ⇒ RestClient::Response
Searches a given unit type based on criteria
44 45 46 |
# File 'lib/runcible/resources/unit.rb', line 44 def search(type, criteria, optional={}) call(:post, path(type), :payload=>{:required=>{:criteria=>criteria}, :optional=>optional}) end |