Class: MPD::Controller::Stats
- Inherits:
-
Object
- Object
- MPD::Controller::Stats
- Defined in:
- lib/mpd/controller/stats.rb
Defined Under Namespace
Classes: Database
Instance Attribute Summary collapse
-
#artists ⇒ Object
readonly
Returns the value of attribute artists.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#playtime ⇒ Object
readonly
Returns the value of attribute playtime.
-
#songs ⇒ Object
readonly
Returns the value of attribute songs.
-
#uptime ⇒ Object
readonly
Returns the value of attribute uptime.
Instance Method Summary collapse
-
#initialize(controller) ⇒ Stats
constructor
A new instance of Stats.
Constructor Details
#initialize(controller) ⇒ Stats
Returns a new instance of Stats.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mpd/controller/stats.rb', line 18 def initialize (controller) @controller = controller response = controller.do_and_raise_if_needed(:stats).to_hash @artists = response[:artists] @songs = response[:songs] @uptime = response[:uptime] @playtime = response[:playtime] @database = Database.new(response[:db_playtime], response[:db_update]) end |
Instance Attribute Details
#artists ⇒ Object (readonly)
Returns the value of attribute artists.
16 17 18 |
# File 'lib/mpd/controller/stats.rb', line 16 def artists @artists end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
16 17 18 |
# File 'lib/mpd/controller/stats.rb', line 16 def controller @controller end |
#database ⇒ Object (readonly)
Returns the value of attribute database.
16 17 18 |
# File 'lib/mpd/controller/stats.rb', line 16 def database @database end |
#playtime ⇒ Object (readonly)
Returns the value of attribute playtime.
16 17 18 |
# File 'lib/mpd/controller/stats.rb', line 16 def playtime @playtime end |
#songs ⇒ Object (readonly)
Returns the value of attribute songs.
16 17 18 |
# File 'lib/mpd/controller/stats.rb', line 16 def songs @songs end |
#uptime ⇒ Object (readonly)
Returns the value of attribute uptime.
16 17 18 |
# File 'lib/mpd/controller/stats.rb', line 16 def uptime @uptime end |