Class: CFoundry::V1::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/cfoundry/v1/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label, version = nil, description = nil, type = nil, provider = "core", state = nil) ⇒ Service

Returns a new instance of Service.



5
6
7
8
9
10
11
12
13
# File 'lib/cfoundry/v1/service.rb', line 5

def initialize(label, version = nil, description = nil,
               type = nil, provider = "core", state = nil)
  @label = label
  @description = description
  @version = version
  @type = type
  @provider = provider
  @state = state
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/cfoundry/v1/service.rb', line 3

def description
  @description
end

#labelObject

Returns the value of attribute label.



3
4
5
# File 'lib/cfoundry/v1/service.rb', line 3

def label
  @label
end

#providerObject

Returns the value of attribute provider.



3
4
5
# File 'lib/cfoundry/v1/service.rb', line 3

def provider
  @provider
end

#stateObject

Returns the value of attribute state.



3
4
5
# File 'lib/cfoundry/v1/service.rb', line 3

def state
  @state
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/cfoundry/v1/service.rb', line 3

def type
  @type
end

#versionObject

Returns the value of attribute version.



3
4
5
# File 'lib/cfoundry/v1/service.rb', line 3

def version
  @version
end

Instance Method Details

#activeObject



20
21
22
# File 'lib/cfoundry/v1/service.rb', line 20

def active
  true
end

#current?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/cfoundry/v1/service.rb', line 28

def current?
  @state == :current
end

#deprecated?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/cfoundry/v1/service.rb', line 24

def deprecated?
  @state == :deprecated
end

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


15
16
17
# File 'lib/cfoundry/v1/service.rb', line 15

def eql?(other)
  other.is_a?(self.class) && other.label == @label
end