Class: Qubell::API

Inherits:
Base
  • Object
show all
Defined in:
lib/qubell_api.rb

Overview

Implements wrapper for Qubell API

Instance Attribute Summary

Attributes inherited from Base

#id, #name

Instance Method Summary collapse

Methods inherited from Base

#==, #to_hash, #to_json, #to_s

Constructor Details

#initialize(options = {}) ⇒ API

Returns a new instance of API.

Parameters:

  • key (HashMap<String => String>)


24
25
26
27
28
# File 'lib/qubell_api.rb', line 24

def initialize(options = {})
  options.each do |key|
    Qubell.configuration.send("#{key[0]}=", key[1])
  end
end

Instance Method Details

#organizationsArray<Qubell::Organization>

Get list of all organizations that current user belong to.

Returns:



32
33
34
35
36
# File 'lib/qubell_api.rb', line 32

def organizations
  Qubell::APICall.get('/organizations').map do |org|
    Qubell::Organization.new(org)
  end
end