Sha256: 81d1c77e6e4e0be6797c3fbb7189a5f13314784c5bc0887bc81e69fb005f4142

Contents?: true

Size: 489 Bytes

Versions: 1

Compression:

Stored size: 489 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)
    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.2.1 lib/mulder/client.rb