Module: VkontakteApi::Resolver

Included in:
Client, Namespace
Defined in:
lib/vkontakte_api/resolver.rb

Overview

A mixin for classes that will resolve other classes' objects via #method_missing.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base_class) ⇒ Object

When this module is included, it undefines the :send instance method in the base_class so it can be resolved via method_missing.



26
27
28
29
30
# File 'lib/vkontakte_api/resolver.rb', line 26

def included(base_class)
  base_class.class_eval do
    undef_method :send
  end
end

Instance Method Details

#resolverHashie::Mash

A Hashie::Mash structure holding the name and token of current instance.

Returns:

  • (Hashie::Mash)


6
7
8
# File 'lib/vkontakte_api/resolver.rb', line 6

def resolver
  @resolver ||= Hashie::Mash.new(name: @name, token: token)
end