Class: TelphinApi::Method

Inherits:
Object
  • Object
show all
Includes:
Resolvable
Defined in:
lib/telphin_api/method.rb

Overview

An API method. It is responsible for generating it's full name and determining it's type.

Constant Summary collapse

PREDICATE_NAMES =

A pattern for names of methods with a boolean result.

/^is.*\?$/

Instance Attribute Summary

Attributes included from Resolvable

#name

Instance Method Summary collapse

Methods included from Resolvable

#initialize, #token

Instance Method Details

#call(args = {}, &block) ⇒ Object

Calling the API method. It delegates the network request to API.call and result processing to Result.process.

Parameters:

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

    Arguments for the API method.



12
13
14
15
# File 'lib/telphin_api/method.rb', line 12

def call(args = {}, &block)
  response = API.call(full_method, args, token)
  Result.process(response, type, block)
end