Class: AwsPricing::Ec2DedicatedHostType
- Inherits:
-
InstanceType
- Object
- InstanceType
- AwsPricing::Ec2DedicatedHostType
- Defined in:
- lib/amazon-pricing/definitions/ec2-dh-type.rb
Instance Attribute Summary
Attributes inherited from InstanceType
#api_name, #compute_units, #disk_in_gb, #disk_type, #memory_in_mb, #name, #platform, #virtual_cores
Instance Method Summary collapse
- #category_types ⇒ Object
-
#initialize(region, family_name) ⇒ Ec2DedicatedHostType
constructor
A new instance of Ec2DedicatedHostType.
- #region ⇒ Object
- #update_dh_pricing(operating_system, dhprice) ⇒ Object
Methods inherited from InstanceType
disk_bytes_per_sec_capacity, #disk_in_mb, disk_ops_per_sec_capacity, #get_breakeven_month, #get_category_type, get_descriptive_cache_name, get_descriptive_name, #memory_in_gb, populate_lookups, #prepay, #price_per_hour, service_type
Constructor Details
#initialize(region, family_name) ⇒ Ec2DedicatedHostType
Returns a new instance of Ec2DedicatedHostType.
6 7 8 9 10 11 |
# File 'lib/amazon-pricing/definitions/ec2-dh-type.rb', line 6 def initialize(region, family_name) @category_types = {} @region = region @name = '' @api_name = family_name end |
Instance Method Details
#category_types ⇒ Object
13 14 15 |
# File 'lib/amazon-pricing/definitions/ec2-dh-type.rb', line 13 def category_types @category_types end |
#region ⇒ Object
17 18 19 |
# File 'lib/amazon-pricing/definitions/ec2-dh-type.rb', line 17 def region @region end |
#update_dh_pricing(operating_system, dhprice) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/amazon-pricing/definitions/ec2-dh-type.rb', line 21 def update_dh_pricing(, dhprice) os = get_category_type() if os.nil? os = .new(self, ) @category_types[] = os end category = .to_s values = { category => dhprice } price = coerce_price(values[category]) os.set_price_per_hour(:ondemand, nil, price) end |