Class: ClusterManagement::Cluster::Services
- Inherits:
- BasicObject
- Defined in:
- lib/cluster_management/cluster.rb
Instance Method Summary collapse
- #[](service_name) ⇒ Object
-
#initialize ⇒ Services
constructor
A new instance of Services.
Constructor Details
#initialize ⇒ Services
Returns a new instance of Services.
3 4 5 6 7 |
# File 'lib/cluster_management/cluster.rb', line 3 def initialize @h = ::Hash.new do |h, service_name| h[service_name] = ::ClusterManagement::Service.service_class(service_name).new end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m) ⇒ Object (protected)
19 20 21 |
# File 'lib/cluster_management/cluster.rb', line 19 def method_missing m @h[m] end |
Instance Method Details
#[](service_name) ⇒ Object
9 10 11 12 |
# File 'lib/cluster_management/cluster.rb', line 9 def [] service_name service_name.must_be.a ::Symbol @h[service_name.to_sym] end |