Class: Runcible::Resources::Unit
- Defined in:
- lib/runcible/resources/unit.rb
Overview
Direct Known Subclasses
Class 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, config=, generate_log_message, generate_payload, get_response, log_debug, log_exception, process_response, required_params
Class Method Details
.path(type) ⇒ String
Generates the API path for Units
34 35 36 |
# File 'lib/runcible/resources/unit.rb', line 34 def self.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 self.search(type, criteria, optional={}) call(:post, path(type), :payload=>{:required=>{:criteria=>criteria}, :optional=>optional}) end |