Class: ManagedServiceInstanceHelper
- Defined in:
- lib/jdc/cli/service/service_instance_helper.rb
Instance Method Summary collapse
-
#initialize(service_instance) ⇒ ManagedServiceInstanceHelper
constructor
A new instance of ManagedServiceInstanceHelper.
- #matches(opts = {}) ⇒ Object
- #name ⇒ Object
- #plan_name ⇒ Object
- #service_bindings ⇒ Object
- #service_label ⇒ Object
- #service_provider ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(service_instance) ⇒ ManagedServiceInstanceHelper
Returns a new instance of ManagedServiceInstanceHelper.
47 48 49 |
# File 'lib/jdc/cli/service/service_instance_helper.rb', line 47 def initialize(service_instance) @instance = service_instance end |
Instance Method Details
#matches(opts = {}) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/jdc/cli/service/service_instance_helper.rb', line 75 def matches(opts = {}) service = opts[:service] plan = opts[:plan] provider = opts[:provider] version = opts[:version] if service return false unless File.fnmatch(service, service_label) end if plan return false unless File.fnmatch(plan.upcase, plan_name.upcase) end if provider return false unless File.fnmatch(provider, service_provider) end if version return false unless File.fnmatch(version, self.version) end true end |
#name ⇒ Object
71 72 73 |
# File 'lib/jdc/cli/service/service_instance_helper.rb', line 71 def name @instance.name end |
#plan_name ⇒ Object
63 64 65 |
# File 'lib/jdc/cli/service/service_instance_helper.rb', line 63 def plan_name @instance.service_plan.name end |
#service_bindings ⇒ Object
67 68 69 |
# File 'lib/jdc/cli/service/service_instance_helper.rb', line 67 def service_bindings @instance.service_bindings end |
#service_label ⇒ Object
51 52 53 |
# File 'lib/jdc/cli/service/service_instance_helper.rb', line 51 def service_label @instance.service_plan.service.label end |
#service_provider ⇒ Object
55 56 57 |
# File 'lib/jdc/cli/service/service_instance_helper.rb', line 55 def service_provider @instance.service_plan.service.provider end |
#version ⇒ Object
59 60 61 |
# File 'lib/jdc/cli/service/service_instance_helper.rb', line 59 def version @instance.service_plan.service.version end |