Class: Ari::Application

Inherits:
Resource show all
Defined in:
lib/ari/resources/application.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#add_listener, client, #client, #remove_all_listeners!, #remove_listener

Methods inherited from Model

#attributes=, #initialize

Constructor Details

This class inherits a constructor from Ari::Model

Instance Attribute Details

#bridge_idsObject (readonly)

Returns the value of attribute bridge_ids.



15
16
17
# File 'lib/ari/resources/application.rb', line 15

def bridge_ids
  @bridge_ids
end

#channel_idsObject (readonly)

Returns the value of attribute channel_ids.



15
16
17
# File 'lib/ari/resources/application.rb', line 15

def channel_ids
  @channel_ids
end

#device_namesObject (readonly)

Returns the value of attribute device_names.



15
16
17
# File 'lib/ari/resources/application.rb', line 15

def device_names
  @device_names
end

#endpoint_idsObject (readonly)

Returns the value of attribute endpoint_ids.



15
16
17
# File 'lib/ari/resources/application.rb', line 15

def endpoint_ids
  @endpoint_ids
end

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'lib/ari/resources/application.rb', line 15

def name
  @name
end

Class Method Details

.get(options = {}) ⇒ Object

GET /applications/%applicationName

Stasis application

Parameters:

applicationName (required) - Application’s name

Raises:

  • (ArgumentError)


38
39
40
41
42
43
# File 'lib/ari/resources/application.rb', line 38

def self.get(options = {})
  raise ArgumentError.new("Parameter applicationName must be passed in options hash.") unless options[:applicationName]
  path = '/applications/%{applicationName}' % options
  response = client(options).get(path, options)
  Application.new(response.merge(client: options[:client]))
end

.list(options = {}) ⇒ Object

GET /applications

Stasis applications



23
24
25
26
27
# File 'lib/ari/resources/application.rb', line 23

def self.list(options = {})
  path = '/applications'
  response = client(options).get(path, options)
  response.map { |hash| Application.new(hash.merge(client: options[:client])) }
end

Instance Method Details

#get(options = {}) ⇒ Object



45
46
47
# File 'lib/ari/resources/application.rb', line 45

def get(options = {})
  self.class.get(options.merge(applicationName: self.id, client: @client))
end

#subscribe(options = {}) ⇒ Object



67
68
69
# File 'lib/ari/resources/application.rb', line 67

def subscribe(options = {})
  self.class.subscribe(options.merge(applicationName: self.id, client: @client))
end

#unsubscribe(options = {}) ⇒ Object



91
92
93
# File 'lib/ari/resources/application.rb', line 91

def unsubscribe(options = {})
  self.class.unsubscribe(options.merge(applicationName: self.id, client: @client))
end