Class: Hula::ServiceBroker::Catalog
- Inherits:
-
Object
- Object
- Hula::ServiceBroker::Catalog
- Defined in:
- lib/hula/service_broker/catalog.rb
Instance Attribute Summary collapse
-
#services ⇒ Object
readonly
Returns the value of attribute services.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(args = {}) ⇒ Catalog
constructor
A new instance of Catalog.
- #service(service_name) ⇒ Object
- #service_plan(service_name, plan_name) ⇒ Object
Constructor Details
Instance Attribute Details
#services ⇒ Object (readonly)
Returns the value of attribute services.
18 19 20 |
# File 'lib/hula/service_broker/catalog.rb', line 18 def services @services end |
Instance Method Details
#==(other) ⇒ Object
24 25 26 27 |
# File 'lib/hula/service_broker/catalog.rb', line 24 def ==(other) is_a?(other.class) && services == other.services end |
#service(service_name) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/hula/service_broker/catalog.rb', line 29 def service(service_name) services.find { |s| s.name == service_name } or fail(ServiceNotFoundError, [ %{Unknown service with name: #{service_name.inspect}}, " Known service names: #{services.map(&:name).inspect}" ].join("\n") ) end |
#service_plan(service_name, plan_name) ⇒ Object
38 39 40 |
# File 'lib/hula/service_broker/catalog.rb', line 38 def service_plan(service_name, plan_name) service(service_name).plan(plan_name) end |