Sha256: 0eb69b73aacc2daef0747f38562483b71189cea15b001ffa2c53cd195cbd13e4

Contents?: true

Size: 814 Bytes

Versions: 45

Compression:

Stored size: 814 Bytes

Contents

module CFoundry::V1
  class Service
    attr_accessor :label, :version, :description, :type, :provider, :state, :service_plans

    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

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

    def active
      true
    end

    def deprecated?
      @state == :deprecated
    end

    def current?
      @state == :current
    end

    def default_service_plan
      service_plans.find(&:default?)
    end

  end
end

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
cloulu-1.0.0 lib/cfoundry/v1/service.rb
cloulu-0.7.0 lib/cfoundry/v1/service.rb
cloulu-0.6.6 lib/cfoundry/v1/service.rb
cloulu-0.6.5 lib/cfoundry/v1/service.rb
cloulu-0.6.1 lib/cfoundry/v1/service.rb
cloulu-0.6.0 lib/cfoundry/v1/service.rb
cloulu-0.5.1 lib/cfoundry/v1/service.rb
cloulu-0.5.0 lib/cfoundry/v1/service.rb
cloulu-0.3.0 lib/cfoundry/v1/service.rb
cloulu-0.2.6 lib/cfoundry/v1/service.rb
cloulu-0.2.5 lib/cfoundry/v1/service.rb
cloulu-0.2.4 lib/cfoundry/v1/service.rb
cloulu-0.2.3 lib/cfoundry/v1/service.rb
cloulu-0.2.1 lib/cfoundry/v1/service.rb
cloulu-0.2.0 lib/cfoundry/v1/service.rb
cloulu-0.1.6 lib/cfoundry/v1/service.rb
cloulu-0.1.5 lib/cfoundry/v1/service.rb
cloulu-0.1.2 lib/cfoundry/v1/service.rb
cloulu-0.1.1 lib/cfoundry/v1/service.rb
static-1.0.3 vendor/cfoundry-0.5.2/lib/cfoundry/v1/service.rb