Module: Cloudcost::Pricing

Defined in:
lib/cloudcost/pricing.rb

Overview

pricing class which implements cost calculation methods for cloudscale.ch resources

Class Method Summary collapse

Class Method Details

.server_costs_per_day(flavor) ⇒ Object



12
13
14
# File 'lib/cloudcost/pricing.rb', line 12

def self.server_costs_per_day(flavor)
  PRICING["servers"][flavor] || raise(PricingError, "#{flavor} flavor not found in pricing.yml")
end

.storage_costs_per_day(type, size_in_gb) ⇒ Object

Raises:



16
17
18
19
20
# File 'lib/cloudcost/pricing.rb', line 16

def self.storage_costs_per_day(type, size_in_gb)
  raise PricingError, "#{type} storage type not found in pricing.yml" unless PRICING["storage"][type]

  PRICING["storage"][type] * size_in_gb
end