class VkontakteApi::Method
An API
method. It is responsible for generating it's full name and determining it's type.
Constants
- PREDICATE_NAMES
A pattern for names of methods with a boolean result.
Public Instance Methods
call(args = {}, &block)
click to toggle source
Calling the API
method. It delegates the network request to `API.call` and result processing to `Result.process`. @param [Hash] args Arguments for the API
method.
# File lib/vkontakte_api/method.rb, line 12 def call(args = {}, &block) response = API.call(full_name, args, token) Result.process(response, type, block) end
Private Instance Methods
camelize(name)
click to toggle source
full_name()
click to toggle source
# File lib/vkontakte_api/method.rb, line 18 def full_name parts = [@previous_resolver.name, @name].compact.map { |part| camelize(part) } parts.join('.').gsub(/[^A-Za-z.]/, '') end
type()
click to toggle source
# File lib/vkontakte_api/method.rb, line 23 def type @name =~ PREDICATE_NAMES ? :boolean : :anything end