Class: Moc::Controller::Status
- Inherits:
-
Object
- Object
- Moc::Controller::Status
- Defined in:
- lib/moc/controller/status.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#song ⇒ Object
readonly
Returns the value of attribute song.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#volume ⇒ Object
readonly
Returns the value of attribute volume.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(controller) ⇒ Status
constructor
A new instance of Status.
- #to_sym ⇒ Object
Constructor Details
#initialize(controller) ⇒ Status
Returns a new instance of Status.
150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/moc/controller/status.rb', line 150 def initialize (controller) @controller = controller @internal = Live.new(controller) @state = @internal.state @volume = @internal.volume if state != :stop @song = Song.new(controller) end end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
148 149 150 |
# File 'lib/moc/controller/status.rb', line 148 def controller @controller end |
#song ⇒ Object (readonly)
Returns the value of attribute song.
148 149 150 |
# File 'lib/moc/controller/status.rb', line 148 def song @song end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
148 149 150 |
# File 'lib/moc/controller/status.rb', line 148 def state @state end |
#volume ⇒ Object (readonly)
Returns the value of attribute volume.
148 149 150 |
# File 'lib/moc/controller/status.rb', line 148 def volume @volume end |
Instance Method Details
#==(other) ⇒ Object
162 163 164 |
# File 'lib/moc/controller/status.rb', line 162 def == (other) super || state == other end |
#to_sym ⇒ Object
166 167 168 |
# File 'lib/moc/controller/status.rb', line 166 def to_sym state.to_sym end |