Class: Bark::Request::Studies
- Inherits:
-
Bark::Request
- Object
- Bark::Request
- Bark::Request::Studies
- Defined in:
- lib/bark/request/studies.rb
Constant Summary collapse
- API_VERSION =
'v2'
- FORMAT =
'json'
- SEARCH_BASE =
[Bark::Request::BASE_URL, API_VERSION].join("/")
- METHODS =
Studies methods are slightly different because of the API differences
{ studies_find_studies: %i{property value exact verbose}, studies_find_trees: %i{property value exact verbose}, studies_properties: %i{}, get_study: %i{study_id}, # GET, not post get_study_tree: %i{study_id tree_id}, # GET, not post }
- REQUIRED_PARAMS =
{ study_id: %i{study get_study_tree}, tree_id: %i{get_study_tree}, property: %i{studies_find_trees}, value: %i{studies_find_trees} }
- METHODS_REQUIRED_PARAMS =
mrp
Constants inherited from Bark::Request
Instance Attribute Summary collapse
-
#method ⇒ Object
Only studies takes a method parameter.
Attributes inherited from Bark::Request
Instance Method Summary collapse
- #assign_options(method: method, params: params) ⇒ Object
-
#initialize(method: :study_list, params: {}) ⇒ Studies
constructor
A new instance of Studies.
- #json_payload ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from Bark::Request
#has_required_params?, #params_are_supported?, #response
Constructor Details
#initialize(method: :study_list, params: {}) ⇒ Studies
Returns a new instance of Studies.
37 38 39 40 |
# File 'lib/bark/request/studies.rb', line 37 def initialize(method: :study_list, params: {}) (method: method, params: params) build_uri if valid? end |
Instance Attribute Details
#method ⇒ Object
Only studies takes a method parameter
35 36 37 |
# File 'lib/bark/request/studies.rb', line 35 def method @method end |
Instance Method Details
#assign_options(method: method, params: params) ⇒ Object
42 43 44 45 |
# File 'lib/bark/request/studies.rb', line 42 def (method: method, params: params) @method = method.to_sym @params = params end |
#json_payload ⇒ Object
52 53 54 |
# File 'lib/bark/request/studies.rb', line 52 def json_payload JSON.generate(@params) end |