Class: Meroku::Infrastructure::Server
- Inherits:
-
Object
- Object
- Meroku::Infrastructure::Server
- Includes:
- Aws::Ec2
- Defined in:
- lib/meroku/infrastructure/server.rb
Overview
A server hosts the api (called during signup, login, etc) and atm also hosts end users applications
Instance Attribute Summary collapse
-
#instance_id ⇒ Object
readonly
Returns the value of attribute instance_id.
Instance Method Summary collapse
-
#initialize(instance_id) ⇒ Server
constructor
A new instance of Server.
- #shutdown ⇒ Object
Methods included from Aws::Ec2
associate_address, #ec2_client, ec2_client, #make_instance, #tag
Constructor Details
#initialize(instance_id) ⇒ Server
Returns a new instance of Server
10 11 12 |
# File 'lib/meroku/infrastructure/server.rb', line 10 def initialize(instance_id) @instance_id = instance_id end |
Instance Attribute Details
#instance_id ⇒ Object (readonly)
Returns the value of attribute instance_id
8 9 10 |
# File 'lib/meroku/infrastructure/server.rb', line 8 def instance_id @instance_id end |
Instance Method Details
#shutdown ⇒ Object
14 15 16 17 |
# File 'lib/meroku/infrastructure/server.rb', line 14 def shutdown puts "Will terminate #{@instance_id}" ec2_client.terminate_instances(instance_ids: [@instance_id]) end |