class VkontakteApi::Namespace

An API method namespace (such as `users` or `friends`).

It includes `Resolvable` and `Resolver` and calls API methods via `Resolver#call_method`. It also holds the list of all known namespaces.

Public Class Methods

exists?(name) click to toggle source

Does a given namespace exist? @param [String, Symbol] name

# File lib/vkontakte_api/namespace.rb, line 31
def exists?(name)
  names.include?(name.to_s)
end
names() click to toggle source

An array of all method namespaces.

Lazily loads the list from `namespaces.yml` and caches it. @return [Array] An array of strings

# File lib/vkontakte_api/namespace.rb, line 20
def names
  if @names.nil?
    filename = File.expand_path('../namespaces.yml', __FILE__)
    @names   = YAML.load_file(filename)
  end
  
  @names
end

Public Instance Methods

method_missing(*args, &block) click to toggle source

Creates and calls the `VkontakteApi::Method` using `VkontakteApi::Resolver#call_method`.

# File lib/vkontakte_api/namespace.rb, line 11
def method_missing(*args, &block)
  call_method(args, &block)
end