Module: VkontakteApi::Resolvable

Included in:
Method, Namespace
Defined in:
lib/vkontakte_api/resolvable.rb

Overview

A mixin for classes that will be resolved via #method_missing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/vkontakte_api/resolvable.rb', line 4

def name
  @name
end

Instance Method Details

#initialize(name, options = {}) ⇒ Object

Creates a resolvable object keeping it's name and the object that resolved it.

Parameters:

  • name (String)

    The name of this resolvable.

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

    a customizable set of options

Options Hash (options):

  • :resolver (Hashie::Mash)

    A mash holding information about the previous resolver.



9
10
11
12
# File 'lib/vkontakte_api/resolvable.rb', line 9

def initialize(name, options = {})
  @name = name.to_s
  @previous_resolver = options.delete(:resolver)
end

#tokenString

Returns the token from the previous resolver.

Returns:

  • (String)

    A token.



16
17
18
# File 'lib/vkontakte_api/resolvable.rb', line 16

def token
  @previous_resolver.token
end