mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
22 lines
308 B
Ruby
22 lines
308 B
Ruby
require './models/mpd_connection'
|
|
|
|
class Artist
|
|
attr_accessor :name
|
|
|
|
def initialize(name)
|
|
@name = name
|
|
end
|
|
|
|
def <=>(artist)
|
|
name <=> artist.name
|
|
end
|
|
|
|
def self.all
|
|
MPDConnection.mpd.artists.sort.map { |artist| Artist.new(artist) }
|
|
end
|
|
|
|
def attributes
|
|
{ name: @name }
|
|
end
|
|
end
|