Class: Mulder::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/mulder/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, app, environment, role) ⇒ Client

Returns a new instance of Client.



6
7
8
9
10
11
# File 'lib/mulder/client.rb', line 6

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

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



4
5
6
# File 'lib/mulder/client.rb', line 4

def app
  @app
end

#environmentObject (readonly)

Returns the value of attribute environment.



4
5
6
# File 'lib/mulder/client.rb', line 4

def environment
  @environment
end

#roleObject (readonly)

Returns the value of attribute role.



4
5
6
# File 'lib/mulder/client.rb', line 4

def role
  @role
end

Instance Method Details

#groupObject



13
14
15
# File 'lib/mulder/client.rb', line 13

def group
  @connection.group_by_id_regexp(id_regexp)
end

#id_regexpObject



21
22
23
# File 'lib/mulder/client.rb', line 21

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

#instancesObject



17
18
19
# File 'lib/mulder/client.rb', line 17

def instances
  @connection.instances_by_group(group)
end