Class: Fog::Compute::CloudSigma::PriceRecord

Inherits:
Fog::CloudSigma::CloudsigmaModel show all
Defined in:
lib/fog/cloudsigma/models/price_record.rb

Instance Method Summary collapse

Methods inherited from Fog::CloudSigma::CloudsigmaModel

model_attribute, model_attribute_array

Instance Method Details

#base_priceObject

The base price of the resource. This is the price for the base API unit which is byte for memory, data, etc. and MHz for CPU. Also the price is per second for time based resource (basically everything except data transfer which is not limited in time)



31
32
33
# File 'lib/fog/cloudsigma/models/price_record.rb', line 31

def base_price
  price / multiplier
end

#priceObject



15
16
17
18
19
20
21
# File 'lib/fog/cloudsigma/models/price_record.rb', line 15

def price
  if attributes[:price]
    BigDecimal(attributes[:price])
  else
    nil
  end
end

#price=(new_price) ⇒ Object



23
24
25
# File 'lib/fog/cloudsigma/models/price_record.rb', line 23

def price=(new_price)
  attributes[:price] = new_price.kind_of?(String) ? new_price : new_price.to_s('F')
end