Class: MPD::Controller::Decoders
- Inherits:
-
Object
- Object
- MPD::Controller::Decoders
- Includes:
- Enumerable
- Defined in:
- lib/mpd/controller/decoders.rb
Defined Under Namespace
Classes: Decoder
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(controller) ⇒ Decoders
constructor
A new instance of Decoders.
Constructor Details
#initialize(controller) ⇒ Decoders
Returns a new instance of Decoders.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/mpd/controller/decoders.rb', line 20 def initialize (controller) @controller = controller @decoders = [] name = nil suffixes = nil mime_types = nil controller.do_and_raise_if_needed(:decoders).each {|type, value| if type == :plugin if name @decoders << Decoder.new(name, suffixes, mime_types) end name = value suffixes = [] mime_types = [] elsif type == :suffix suffixes << value elsif type == :mime_type mime_types << value end } end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
18 19 20 |
# File 'lib/mpd/controller/decoders.rb', line 18 def controller @controller end |
Instance Method Details
#each(&block) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/mpd/controller/decoders.rb', line 45 def each (&block) return to_enum unless block_given? @decoders.each(&block) self end |