Class: Moc::Controller::Status::Live
- Inherits:
-
Object
- Object
- Moc::Controller::Status::Live
- Defined in:
- lib/moc/controller/status.rb
Defined Under Namespace
Classes: Song
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(controller) ⇒ Live
constructor
A new instance of Live.
- #song ⇒ Object
- #state ⇒ Object
- #to_sym ⇒ Object
- #volume ⇒ Object
Constructor Details
#initialize(controller) ⇒ Live
Returns a new instance of Live.
86 87 88 |
# File 'lib/moc/controller/status.rb', line 86 def initialize (controller) @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
84 85 86 |
# File 'lib/moc/controller/status.rb', line 84 def controller @controller end |
Instance Method Details
#==(other) ⇒ Object
90 91 92 |
# File 'lib/moc/controller/status.rb', line 90 def == (other) super || state == other end |
#song ⇒ Object
104 105 106 107 108 |
# File 'lib/moc/controller/status.rb', line 104 def song return if self == :stop Song.new(controller) end |
#state ⇒ Object
94 95 96 97 |
# File 'lib/moc/controller/status.rb', line 94 def state controller.send_command :get_state controller.get_state end |
#to_sym ⇒ Object
110 111 112 |
# File 'lib/moc/controller/status.rb', line 110 def to_sym state.to_sym end |
#volume ⇒ Object
99 100 101 102 |
# File 'lib/moc/controller/status.rb', line 99 def volume controller.send_command :get_mixer controller.get_integer.to_i end |