Module: Calculated::GenericObjectApiCalls

Included in:
Session
Defined in:
lib/calculated/generic_object_api_calls.rb

Instance Method Summary collapse

Instance Method Details

#formula_inputs_for_generic_object(id, params = {}) ⇒ Array<Calculated::Models::FormulaInput>

Parameters:

  • id (String)
  • params (Hash) (defaults to: {})

Returns:



24
25
26
27
28
# File 'lib/calculated/generic_object_api_calls.rb', line 24

def formula_inputs_for_generic_object(id, params = {})
  api_call(:get, "/generic_objects/#{id}/formula_inputs", params) do |response|
   response["formula_inputs"].map{|formula_input| Calculated::Models::FormulaInput.new(formula_input)}
  end
end

#generic_object(id, params = {}) ⇒ Calculated::Models::GeneriObject

Returns Calculated::Models::GeneriObject

Parameters:

  • id (String)
  • params (Hash) (defaults to: {})

Returns:

  • (Calculated::Models::GeneriObject)

    Calculated::Models::GeneriObject



15
16
17
18
19
# File 'lib/calculated/generic_object_api_calls.rb', line 15

def generic_object(id, params = {})
  api_call(:get, "/generic_objects/#{id}", params) do |response|
     Calculated::Models::GenericObject.new(response["generic_object"])
  end
end

#generic_objects(params = {}) ⇒ Array<Calculated::Models::GeneriObject>

Parameters:

  • params (Hash) (defaults to: {})

Returns:

  • (Array<Calculated::Models::GeneriObject>)


6
7
8
9
10
# File 'lib/calculated/generic_object_api_calls.rb', line 6

def generic_objects(params = {})
  api_call(:get, "/generic_objects", params) do |response|
    response["generic_objects"].map{|generic_object| Calculated::Models::GenericObject.new(generic_object)}
  end
end