Class: Mulder::Client
- Inherits:
-
Object
- Object
- Mulder::Client
- Defined in:
- lib/mulder/client.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
- #group ⇒ Object
- #id_regexp ⇒ Object
-
#initialize(connection, app, environment, role) ⇒ Client
constructor
A new instance of Client.
- #instances ⇒ Object
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
#app ⇒ Object (readonly)
Returns the value of attribute app.
4 5 6 |
# File 'lib/mulder/client.rb', line 4 def app @app end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
4 5 6 |
# File 'lib/mulder/client.rb', line 4 def environment @environment end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
4 5 6 |
# File 'lib/mulder/client.rb', line 4 def role @role end |
Instance Method Details
#group ⇒ Object
13 14 15 |
# File 'lib/mulder/client.rb', line 13 def group @connection.group_by_id_regexp(id_regexp) end |
#id_regexp ⇒ Object
21 22 23 |
# File 'lib/mulder/client.rb', line 21 def id_regexp /^#{@app}-#{@environment}-(.*-)?#{@role}-.*$/i end |
#instances ⇒ Object
17 18 19 |
# File 'lib/mulder/client.rb', line 17 def instances @connection.instances_by_group(group) end |