Class: RDSTUNE::Ec2Info
- Inherits:
-
Object
- Object
- RDSTUNE::Ec2Info
- Defined in:
- lib/ec2info.rb
Instance Method Summary collapse
- #get_memory ⇒ Object
-
#initialize(instance_type) ⇒ Ec2Info
constructor
A new instance of Ec2Info.
- #show ⇒ Object
Constructor Details
#initialize(instance_type) ⇒ Ec2Info
Returns a new instance of Ec2Info.
6 7 8 9 |
# File 'lib/ec2info.rb', line 6 def initialize(instance_type) @instance_type = instance_type @ec2info = JSON.parse(Net::HTTP.get(URI('https://www.ec2instances.info/rds/instances.json'))) end |
Instance Method Details
#get_memory ⇒ Object
15 16 17 18 |
# File 'lib/ec2info.rb', line 15 def get_memory() m = @ec2info.select {|instances| instances['instance_type'] == @instance_type} m.first["memory"].to_f end |
#show ⇒ Object
11 12 13 |
# File 'lib/ec2info.rb', line 11 def show() puts get() end |