Class: QuickbloxApi::BaseClient

Inherits:
Object
  • Object
show all
Includes:
Config, Helpers
Defined in:
lib/quickblox_api/base_client.rb

Direct Known Subclasses

Client, UserClient

Instance Method Summary collapse

Methods included from Helpers

#safe_parse

Constructor Details

#initialize(opts = {}) ⇒ BaseClient

Returns a new instance of BaseClient.

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
# File 'lib/quickblox_api/base_client.rb', line 5

def initialize(opts = {})
  raise(ArgumentError, 'secrets not specified') unless opts[:secrets].is_a?(Hash)
  opts.each do |name, value|
    instance_variable_set("@#{name}", value)
    self.class.send(:attr_reader, name)
  end
end

Instance Method Details

#query(type, path, body = {}) ⇒ Object



13
14
15
# File 'lib/quickblox_api/base_client.rb', line 13

def query(type, path, body = {})
  _query(type, path, body.merge(token: get_token))
end