Class: Clickmeetings::Open::Token

Inherits:
Model show all
Includes:
WithConference
Defined in:
lib/clickmeetings/models/open/token.rb

Defined Under Namespace

Classes: NoConferenceError

Instance Attribute Summary collapse

Attributes inherited from Model

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from WithConference

#initialize, #remote_url

Methods inherited from Model

api_key, client_options, #default_headers, ping, with_account

Methods inherited from Model

#action_path, #client, client_options, #default_headers, #default_params, #destroy, find, #handle_response, #remote_path, #remote_url, set_resource_name, #update

Instance Attribute Details

#first_use_dateObject

Returns the value of attribute first_use_date.



10
11
12
# File 'lib/clickmeetings/models/open/token.rb', line 10

def first_use_date
  @first_use_date
end

#sent_to_emailObject

Returns the value of attribute sent_to_email.



10
11
12
# File 'lib/clickmeetings/models/open/token.rb', line 10

def sent_to_email
  @sent_to_email
end

#tokenObject

Returns the value of attribute token.



10
11
12
# File 'lib/clickmeetings/models/open/token.rb', line 10

def token
  @token
end

Class Method Details

.allObject



13
14
15
16
17
18
19
# File 'lib/clickmeetings/models/open/token.rb', line 13

def all
  fail NoConferenceError if conference_id.nil?
  response = Clickmeetings.with_client(client_options) do
    Clickmeetings.client.get remote_url(__method__), default_params, default_headers
  end
  handle_response response["access_tokens"]
end

.create(params = {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/clickmeetings/models/open/token.rb', line 21

def create(params = {})
  fail NoConferenceError if conference_id.nil?
  response = Clickmeetings.with_client(client_options) do
    Clickmeetings.client.post remote_url(__method__), params.merge(default_params), default_headers
  end
  handle_response response["access_tokens"]
end

Instance Method Details

#create_hash(params = {}) ⇒ Object



30
31
32
# File 'lib/clickmeetings/models/open/token.rb', line 30

def create_hash(params = {})
  LoginHash.create params.merge(conference_id: conference_id, token: token)
end