Class: OpsWorker::Instance
- Inherits:
-
Object
- Object
- OpsWorker::Instance
- Defined in:
- lib/ops_worker/instance.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#availability_zone ⇒ Object
readonly
Returns the value of attribute availability_zone.
-
#elastic_ip ⇒ Object
readonly
Returns the value of attribute elastic_ip.
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#instance_type ⇒ Object
readonly
Returns the value of attribute instance_type.
-
#layers ⇒ Object
readonly
Returns the value of attribute layers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(id, hostname, status, instance_type, elastic_ip, availability_zone, app, layers) ⇒ Instance
constructor
A new instance of Instance.
- #online? ⇒ Boolean
- #stopped? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(id, hostname, status, instance_type, elastic_ip, availability_zone, app, layers) ⇒ Instance
Returns a new instance of Instance.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ops_worker/instance.rb', line 5 def initialize(id, hostname, status, instance_type, elastic_ip, availability_zone, app, layers) @id = id @hostname = hostname @status = status @instance_type = instance_type @elastic_ip = elastic_ip @availability_zone = availability_zone @app = app @layers = layers end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
3 4 5 |
# File 'lib/ops_worker/instance.rb', line 3 def app @app end |
#availability_zone ⇒ Object (readonly)
Returns the value of attribute availability_zone.
3 4 5 |
# File 'lib/ops_worker/instance.rb', line 3 def availability_zone @availability_zone end |
#elastic_ip ⇒ Object (readonly)
Returns the value of attribute elastic_ip.
3 4 5 |
# File 'lib/ops_worker/instance.rb', line 3 def elastic_ip @elastic_ip end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
3 4 5 |
# File 'lib/ops_worker/instance.rb', line 3 def hostname @hostname end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/ops_worker/instance.rb', line 3 def id @id end |
#instance_type ⇒ Object (readonly)
Returns the value of attribute instance_type.
3 4 5 |
# File 'lib/ops_worker/instance.rb', line 3 def instance_type @instance_type end |
#layers ⇒ Object (readonly)
Returns the value of attribute layers.
3 4 5 |
# File 'lib/ops_worker/instance.rb', line 3 def layers @layers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/ops_worker/instance.rb', line 3 def status @status end |
Instance Method Details
#online? ⇒ Boolean
20 21 22 |
# File 'lib/ops_worker/instance.rb', line 20 def online? @status == "online" end |
#stopped? ⇒ Boolean
16 17 18 |
# File 'lib/ops_worker/instance.rb', line 16 def stopped? @status == "stopped" end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/ops_worker/instance.rb', line 24 def to_s "#<OpsWorker::Instance #{@id}, host: #{@hostname}, status: #{@status}, type: #{@instance_type}, layers: #{@layers.map(&:name)}>" end |