Class: MPD::Controller::Database::Artist
- Inherits:
-
Object
- Object
- MPD::Controller::Database::Artist
- Defined in:
- lib/mpd/controller/database.rb
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(database, name) ⇒ Artist
constructor
A new instance of Artist.
- #inspect ⇒ Object
- #nil? ⇒ Boolean
- #songs(strict = false) ⇒ Object
Constructor Details
#initialize(database, name) ⇒ Artist
Returns a new instance of Artist.
140 141 142 143 |
# File 'lib/mpd/controller/database.rb', line 140 def initialize (database, name) @database = database @name = name end |
Instance Attribute Details
#database ⇒ Object (readonly)
Returns the value of attribute database.
138 139 140 |
# File 'lib/mpd/controller/database.rb', line 138 def database @database end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
138 139 140 |
# File 'lib/mpd/controller/database.rb', line 138 def name @name end |
Instance Method Details
#inspect ⇒ Object
153 154 155 |
# File 'lib/mpd/controller/database.rb', line 153 def inspect "#<#{self.class.name}: #{name.inspect}>" end |
#nil? ⇒ Boolean
145 146 147 |
# File 'lib/mpd/controller/database.rb', line 145 def nil? name.empty? end |
#songs(strict = false) ⇒ Object
149 150 151 |
# File 'lib/mpd/controller/database.rb', line 149 def songs (strict = false) database.search(name, tag: :artist, strict: strict) end |