Class: Icecast::Server::StreamStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/icecast/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parsed_status) ⇒ StreamStatus

Returns a new instance of StreamStatus.



84
85
86
# File 'lib/icecast/server.rb', line 84

def initialize(parsed_status)
  @parsed_status = parsed_status
end

Instance Attribute Details

#parsed_statusObject

Returns the value of attribute parsed_status.



82
83
84
# File 'lib/icecast/server.rb', line 82

def parsed_status
  @parsed_status
end

Instance Method Details

#listenersObject



92
93
94
# File 'lib/icecast/server.rb', line 92

def listeners
  started? ? parsed_status["listeners"].to_i : 0
end

#started?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/icecast/server.rb', line 88

def started?
  parsed_status.present?
end