Class: CubeSmart::Price
- Inherits:
-
Object
- Object
- CubeSmart::Price
- Defined in:
- lib/cubesmart/price.rb
Overview
The price (id + dimensions + rate) for a facility
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, dimensions:, features:, rates:) ⇒ Price
constructor
A new instance of Price.
- #inspect ⇒ String
-
#text ⇒ String
E.g.
Constructor Details
#initialize(id:, dimensions:, features:, rates:) ⇒ Price
Returns a new instance of Price.
26 27 28 29 30 31 |
# File 'lib/cubesmart/price.rb', line 26 def initialize(id:, dimensions:, features:, rates:) @id = id @dimensions = dimensions @features = features @rates = rates end |
Instance Attribute Details
#dimensions ⇒ Dimensions
12 13 14 |
# File 'lib/cubesmart/price.rb', line 12 def dimensions @dimensions end |
#id ⇒ String
8 9 10 |
# File 'lib/cubesmart/price.rb', line 8 def id @id end |
Class Method Details
Instance Method Details
#inspect ⇒ String
34 35 36 37 38 39 40 41 42 |
# File 'lib/cubesmart/price.rb', line 34 def inspect props = [ "id=#{@id.inspect}", "dimensions=#{@dimensions.inspect}", "features=#{@features.inspect}", "rates=#{@rates.inspect}" ] "#<#{self.class.name} #{props.join(' ')}>" end |
#text ⇒ String
Returns e.g. “123 | 5’ × 5’ (25 sqft) | $100 (street) / $90 (web)”.
45 46 47 |
# File 'lib/cubesmart/price.rb', line 45 def text "#{@id} | #{@dimensions.text} | #{@rates.text} | #{@features.text}" end |