Sha256: 5f528569f713282c54e5f5f5e3a26fb4424e812742540a5ae8431a65058bb8a4

Contents?: true

Size: 503 Bytes

Versions: 1

Compression:

Stored size: 503 Bytes

Contents

module Mulder
  class Client

    attr_reader :app, :role, :environment

    def initialize(connection, app, environment, role)
      @connection  = connection
      @app         = app
      @environment = environment
      @role        = role
    end

    def group
      @connection.group_by_id_regexp(id_regexp)
    end

    def instances
      @connection.instances_by_group(group).select(&:exists?)
    end

    def id_regexp
      /^#{@app}-#{@environment}-(.*-)?#{@role}-.*$/i
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mulder-0.4.0 lib/mulder/client.rb