Class: MPD::Controller::SupportedProtocols

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/mpd/controller/supported_protocols.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ SupportedProtocols

Returns a new instance of SupportedProtocols.



18
19
20
21
22
23
24
25
# File 'lib/mpd/controller/supported_protocols.rb', line 18

def initialize (controller)
  @controller = controller
  @supported  = []

  controller.do_and_raise_if_needed(:urlhandlers).each {|_, name|
    @supported << name[0 .. -4]
  }
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



16
17
18
# File 'lib/mpd/controller/supported_protocols.rb', line 16

def controller
  @controller
end

Instance Method Details

#each(&block) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/mpd/controller/supported_protocols.rb', line 27

def each (&block)
  return to_enum unless block_given?

  @supported.each(&block)

  self
end