Class: Moc::Controller::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/moc/controller/status.rb

Defined Under Namespace

Classes: Live, Song

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#controllerObject (readonly)

Returns the value of attribute controller.



148
149
150
# File 'lib/moc/controller/status.rb', line 148

def controller
  @controller
end

#songObject (readonly)

Returns the value of attribute song.



148
149
150
# File 'lib/moc/controller/status.rb', line 148

def song
  @song
end

#stateObject (readonly)

Returns the value of attribute state.



148
149
150
# File 'lib/moc/controller/status.rb', line 148

def state
  @state
end

#volumeObject (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_symObject



166
167
168
# File 'lib/moc/controller/status.rb', line 166

def to_sym
	state.to_sym
end