Class: Wowza::REST::Instances
- Inherits:
-
Object
- Object
- Wowza::REST::Instances
- Defined in:
- lib/wowza/rest/instances.rb
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(conn, application) ⇒ Instances
constructor
A new instance of Instances.
Constructor Details
#initialize(conn, application) ⇒ Instances
Returns a new instance of Instances.
5 6 7 8 |
# File 'lib/wowza/rest/instances.rb', line 5 def initialize(conn, application) @conn = conn @application = application end |
Instance Method Details
#all ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/wowza/rest/instances.rb', line 10 def all resp = conn.get("#{application.href}/instances") JSON.parse(resp.body)['instanceList'].map do |attrs| instance = Instance.new({ name: attrs["name"] }) streams = attrs.fetch("incomingStreams", []) instance.incoming_streams = streams.map do |stream| attrs = Stream.deserialize(stream) Stream.new(attrs.merge({ conn: conn })) end instance end end |