Class: RubyHome::ServiceCollection
- Inherits:
-
Object
- Object
- RubyHome::ServiceCollection
- Includes:
- Enumerable
- Defined in:
- lib/ruby_home/service_collection.rb
Instance Method Summary collapse
- #<<(service) ⇒ Object
- #characteristics ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(*services) ⇒ ServiceCollection
constructor
A new instance of ServiceCollection.
Constructor Details
#initialize(*services) ⇒ ServiceCollection
Returns a new instance of ServiceCollection.
5 6 7 |
# File 'lib/ruby_home/service_collection.rb', line 5 def initialize(*services) @services = services end |
Instance Method Details
#<<(service) ⇒ Object
13 14 15 |
# File 'lib/ruby_home/service_collection.rb', line 13 def <<(service) @services << service end |
#characteristics ⇒ Object
17 18 19 |
# File 'lib/ruby_home/service_collection.rb', line 17 def characteristics flat_map(&:characteristics).flat_map(&:all) end |
#each(&block) ⇒ Object
9 10 11 |
# File 'lib/ruby_home/service_collection.rb', line 9 def each(&block) services.each(&block) end |