Class: Vk::Schema::Namespace

Inherits:
Object
  • Object
show all
Defined in:
lib/vk/schema/namespace.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace, client) ⇒ Namespace

Returns a new instance of Namespace.

Parameters:



9
10
11
12
# File 'lib/vk/schema/namespace.rb', line 9

def initialize(namespace, client)
  @namespace = namespace
  @client = client
end

Instance Attribute Details

#clientVk::Client (readonly)

Returns:



15
16
17
# File 'lib/vk/schema/namespace.rb', line 15

def client
  @client
end

Instance Method Details

#call(method, args) ⇒ Vk::Schema::Response

Parameters:

  • method (String)
  • args (Hash)

Returns:



20
21
22
23
24
# File 'lib/vk/schema/namespace.rb', line 20

def call(method, args)
  method = method_classes[method].new(args)
  response = @client.request(method.method, method.to_hash)
  response_classes[method].new(response)
end