Class: MPD::Controller::SupportedProtocols
- Inherits:
-
Object
- Object
- MPD::Controller::SupportedProtocols
- Includes:
- Enumerable
- Defined in:
- lib/mpd/controller/supported_protocols.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(controller) ⇒ SupportedProtocols
constructor
A new instance of SupportedProtocols.
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
#controller ⇒ Object (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 |