class ScaleEngineAPI

Constants

VERSION

The version of the gem

Public Instance Methods

method_missing(method, *args) click to toggle source

Normal API methods found under the API documentation at cp.scaleengine.net/docs/api

# File lib/scaleengine.rb, line 24
def method_missing(method, *args)
  params = args[0].is_a?(Hash) ? args[0] : {}

  # Set the vairous params that are required for each test
  params[:command] = "#{method}"
  params[:api_key] = Configuration.api_key
  params[:cdn] = Configuration.cdn

  Request.new(Configuration.api_end_point, params)
end
record_control(action, params) click to toggle source

Specific endpoint for record_controls action

# File lib/scaleengine.rb, line 10
def record_control(action, params)
  if not params.is_a?(Hash)
    # Invalid params type. Not a hash
    raise InvalidParamsException.new("Params must be hash")
  elsif action.blank?
    # Missing action
    raise InvalidParamsException.new("Action must not be empty")
  end

  params[:action] = action
  Request.new(Configuration.record_control_end_point, params)
end