Class: CFoundry::V1::Service
- Inherits:
-
Object
- Object
- CFoundry::V1::Service
- Defined in:
- lib/cfoundry/v1/service.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#label ⇒ Object
Returns the value of attribute label.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#service_plans ⇒ Object
Returns the value of attribute service_plans.
-
#state ⇒ Object
Returns the value of attribute state.
-
#type ⇒ Object
Returns the value of attribute type.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #active ⇒ Object
- #current? ⇒ Boolean
- #default_service_plan ⇒ Object
- #deprecated? ⇒ Boolean
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(label, version = nil, description = nil, type = nil, provider = "core", state = nil, service_plans = []) ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize(label, version = nil, description = nil, type = nil, provider = "core", state = nil, service_plans = []) ⇒ Service
Returns a new instance of Service.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/cfoundry/v1/service.rb', line 5 def initialize(label, version = nil, description = nil, type = nil, provider = "core", state = nil, service_plans = []) @label = label @description = description @version = version @type = type @provider = provider @state = state @service_plans = service_plans end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/cfoundry/v1/service.rb', line 3 def description @description end |
#label ⇒ Object
Returns the value of attribute label.
3 4 5 |
# File 'lib/cfoundry/v1/service.rb', line 3 def label @label end |
#provider ⇒ Object
Returns the value of attribute provider.
3 4 5 |
# File 'lib/cfoundry/v1/service.rb', line 3 def provider @provider end |
#service_plans ⇒ Object
Returns the value of attribute service_plans.
3 4 5 |
# File 'lib/cfoundry/v1/service.rb', line 3 def service_plans @service_plans end |
#state ⇒ Object
Returns the value of attribute state.
3 4 5 |
# File 'lib/cfoundry/v1/service.rb', line 3 def state @state end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/cfoundry/v1/service.rb', line 3 def type @type end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/cfoundry/v1/service.rb', line 3 def version @version end |
Instance Method Details
#active ⇒ Object
22 23 24 |
# File 'lib/cfoundry/v1/service.rb', line 22 def active true end |
#current? ⇒ Boolean
30 31 32 |
# File 'lib/cfoundry/v1/service.rb', line 30 def current? @state == :current end |
#default_service_plan ⇒ Object
34 35 36 |
# File 'lib/cfoundry/v1/service.rb', line 34 def default_service_plan service_plans.find(&:default?) end |
#deprecated? ⇒ Boolean
26 27 28 |
# File 'lib/cfoundry/v1/service.rb', line 26 def deprecated? @state == :deprecated end |
#eql?(other) ⇒ Boolean Also known as: ==
17 18 19 |
# File 'lib/cfoundry/v1/service.rb', line 17 def eql?(other) other.is_a?(self.class) && other.label == @label end |