Class: Vkdonate::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/vkdonate/client.rb

Overview

Client which saves API key

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Client

New client to work with API

Parameters:

  • api_key (String)


8
9
10
11
# File 'lib/vkdonate/client.rb', line 8

def initialize(api_key)
  @api_key = api_key.to_s
  raise 'API key can not be empty' if @api_key.empty?
end

Instance Method Details

#donates(**options) ⇒ Object

See Also:

  • VkDonate.donates


19
20
21
# File 'lib/vkdonate/client.rb', line 19

def donates(**options)
  Vkdonate.donates(@api_key, **options)
end

#request(action, **options) ⇒ Object

See Also:

  • VkDonate.request


14
15
16
# File 'lib/vkdonate/client.rb', line 14

def request(action, **options)
  Vkdonate.request(@api_key, action, **options)
end