Class: UOM::CompositeDimension

Inherits:
Dimension show all
Defined in:
lib/uom/dimension.rb

Overview

A CompositeDimension combines dimensions with an operator.

Instance Attribute Summary collapse

Attributes inherited from Dimension

#label

Instance Method Summary collapse

Methods inherited from Dimension

#to_s

Constructor Details

#initialize(dimensions, operator) ⇒ CompositeDimension

Creates a CompositeDimension from the given dimensions and operator symbol



25
26
27
28
29
30
31
# File 'lib/uom/dimension.rb', line 25

def initialize(dimensions, operator)
  @dimensions = dimensions
  @operator = operator
  super(create_label)
  # add to the extent
  CompositeDimension << self
end

Instance Attribute Details

#dimensionsObject (readonly)

Returns the value of attribute dimensions.



22
23
24
# File 'lib/uom/dimension.rb', line 22

def dimensions
  @dimensions
end

#operatorObject (readonly)

Returns the value of attribute operator.



22
23
24
# File 'lib/uom/dimension.rb', line 22

def operator
  @operator
end