Class: Wowza::REST::Applications

Inherits:
Object
  • Object
show all
Defined in:
lib/wowza/rest/applications.rb

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Applications

Returns a new instance of Applications.



5
6
7
# File 'lib/wowza/rest/applications.rb', line 5

def initialize(conn)
  @conn = conn
end

Instance Method Details

#allObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/wowza/rest/applications.rb', line 9

def all
  resp = conn.get('/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications')
  JSON.parse(resp.body)['applications'].map do |attrs|
    Application.new({
      id: attrs["id"],
      href: attrs["href"],
      app_type: attrs["appType"],
      dvr_enabled: attrs["dvrEnabled"],
      drm_enabled: attrs["drmEnabled"],
      transcoder_enabled: attrs["transcoderEnabled"],
      stream_targets_enabled: attrs["streamTargetsEnabled"],
    }).tap do |app|
      app.conn = conn
    end
  end
end