Module: Calculated::ObjectTemplateApiCalls
- Included in:
- Session
- Defined in:
- lib/calculated/object_template_api_calls.rb
Instance Method Summary collapse
-
#generic_objects_for_object_template(name, params = {}) ⇒ Calculated::Models::ObjectTemplate
this request will have loaded generic objects for the ready basically.
-
#generic_objects_for_object_template_with_filter(name, filter, params = {}) ⇒ Calculated::Models::GeneriObject
This will filter the results of the generic objects from a simple text search note this is not an expancive text search so limit to 1 word searches for best results.
- #object_template(id, params = {}) ⇒ Calculated::Models::ObjectTemplate
- #object_templates(params = {}) ⇒ Array<Calculated::Models::ObjectTemplate>
-
#relatable_categories_for_object_template(name, related_attribute, params = {}) ⇒ Calculated::Models::ObjectTemplate
this request will have loaded relatable categories for the object template.
Instance Method Details
#generic_objects_for_object_template(name, params = {}) ⇒ Calculated::Models::ObjectTemplate
this request will have loaded generic objects for the ready basically
27 28 29 30 31 |
# File 'lib/calculated/object_template_api_calls.rb', line 27 def generic_objects_for_object_template(name, params = {}) api_call(:get, "/object_templates/#{name}/generic_objects", params) do |response| Calculated::Models::ObjectTemplate.new(response["object_template"]) end end |
#generic_objects_for_object_template_with_filter(name, filter, params = {}) ⇒ Calculated::Models::GeneriObject
This will filter the results of the generic objects from a simple text search note this is not an expancive text search so limit to 1 word searches for best results
this request will have loaded relatable categories for the object template
64 65 66 67 68 |
# File 'lib/calculated/object_template_api_calls.rb', line 64 def generic_objects_for_object_template_with_filter(name, filter, params = {}) api_call(:get, "/object_templates/#{name}/generic_objects/filter", params.merge!(:filter => filter)) do |response| Calculated::Models::ObjectTemplate.new(response["object_template"]) end end |
#object_template(id, params = {}) ⇒ Calculated::Models::ObjectTemplate
8 9 10 11 12 |
# File 'lib/calculated/object_template_api_calls.rb', line 8 def object_template(id, params = {}) api_call(:get, "/object_templates/#{id}", params) do |response| Calculated::Models::ObjectTemplate.new(response["object_template"]) end end |
#object_templates(params = {}) ⇒ Array<Calculated::Models::ObjectTemplate>
16 17 18 19 20 |
# File 'lib/calculated/object_template_api_calls.rb', line 16 def object_templates(params = {}) api_call(:get, "/object_templates", params) do |response| response["object_templates"].map{|object_template| Calculated::Models::ObjectTemplate.new(object_template)} end end |
#relatable_categories_for_object_template(name, related_attribute, params = {}) ⇒ Calculated::Models::ObjectTemplate
this request will have loaded relatable categories for the object template
38 39 40 41 42 |
# File 'lib/calculated/object_template_api_calls.rb', line 38 def relatable_categories_for_object_template(name, , params = {}) api_call(:get, "/object_templates/#{name}/relatable_categories", params.merge!(:related_attribute => )) do |response| Calculated::Models::ObjectTemplate.new(response["object_template"]) end end |