Class: Sem4r::InfoSelector

Inherits:
Object
  • Object
show all
Includes:
Sem4rSoap::SoapAttributes
Defined in:
lib/sem4r/info/info_selector.rb

Overview

FREE_USAGE_API_UNITS_PER_MONTH

Retrieves the number of  free API units that can be used by the developer
token being used to make the call for this month.
Specify only the apiUsageType parameter.

TOTAL_USAGE_API_UNITS_PER_MONTH

Retrieves the total number of API units for this entire month that can
be used by the developer token being used to make this call. Includes
both free and paid API units.
Specify only the apiUsageType parameter.

OPERATION_COUNT

Retrieves the number of operations recorded for the developer token
being used to make this call over the given date range.
The given dates
are inclusive; to get the operation count for a single day, supply it as
both the start and end date.
Specify the apiUsageType and dateRange parameters.

UNIT_COUNT

Retrieves the number of API units recorded for the developer token being
used to make this call.
  o Specify the apiUsageType and dateRange parameters to retrieve
    the units recorded over the given date range.
  o Specify the apiUsageType, serviceName, methodName, operator,
    dateRange to retrieve the units recorded over the given date
    range for a specified method.

UNIT_COUNT_FOR_CLIENTS

Retrieves the number of API units recorded for a subset of clients over
the given date range for the developer token being used to make this
call.
The given dates are inclusive; to get the unit count for a single
day, supply it as both the start and end date.
Specify the apiUsageType, dateRange and clientEmails parameters.

METHOD_COST

Retrieves the cost, in API units per operation, of the given method on
a specific date for the developer token being used to make this call.

Methods default to a cost of 1. Specify the apiUsageType, dateRange
(start date and end date should be the same), serviceName, methodName,
operator parameters.

Instance Method Summary collapse

Methods included from Sem4rSoap::SoapAttributes

#_from_element, #_to_s, #_to_xml, included

Constructor Details

#initialize(&block) ⇒ InfoSelector

Returns a new instance of InfoSelector.



90
91
92
93
94
# File 'lib/sem4r/info/info_selector.rb', line 90

def initialize(&block)
  if block_given?
    block.arity < 1 ? instance_eval(&block) : block.call(self)
  end
end

Instance Method Details

#to_xmlObject



96
97
98
99
100
101
102
103
104
105
106
# File 'lib/sem4r/info/info_selector.rb', line 96

def to_xml
  <<-EOFS
    <s:selector>
      <s:dateRange>
        <min>#{min}</min>
        <max>#{max}</max>
      </s:dateRange>
      <s:apiUsageType>#{usage_type}</s:apiUsageType>
    </s:selector>
  EOFS
end