Class: MPD::Controller::Stickers::Sticker
- Inherits:
-
Object
- Object
- MPD::Controller::Stickers::Sticker
- Defined in:
- lib/mpd/controller/stickers.rb
Instance Attribute Summary collapse
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #delete! ⇒ Object
-
#initialize(element, name) ⇒ Sticker
constructor
A new instance of Sticker.
- #inspect ⇒ Object
- #value ⇒ Object
- #value=(value) ⇒ Object
Constructor Details
#initialize(element, name) ⇒ Sticker
Returns a new instance of Sticker.
17 18 19 20 |
# File 'lib/mpd/controller/stickers.rb', line 17 def initialize (element, name) @element = element @name = name end |
Instance Attribute Details
#element ⇒ Object (readonly)
Returns the value of attribute element.
15 16 17 |
# File 'lib/mpd/controller/stickers.rb', line 15 def element @element end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/mpd/controller/stickers.rb', line 15 def name @name end |
Instance Method Details
#delete! ⇒ Object
33 34 35 |
# File 'lib/mpd/controller/stickers.rb', line 33 def delete! @element.stickers.controller.do_and_raise_if_needed(:sticker, :delete, element.type, element.uri, name) end |
#inspect ⇒ Object
37 38 39 |
# File 'lib/mpd/controller/stickers.rb', line 37 def inspect "#<#{self.class.name}(#{name}): #{value.inspect}>" end |
#value ⇒ Object
22 23 24 25 26 27 |
# File 'lib/mpd/controller/stickers.rb', line 22 def value response = @element.stickers.controller.do_and_raise_if_needed(:sticker, :get, element.type, element.uri, name) name, value = response.first.last.split '=', 2 value end |
#value=(value) ⇒ Object
29 30 31 |
# File 'lib/mpd/controller/stickers.rb', line 29 def value= (value) @element.stickers.controller.do_and_raise_if_needed(:sticker, :set, element.type, element.uri, name, value) end |