Class: MDQuery::Dataset::DimensionValue
- Inherits:
-
Object
- Object
- MDQuery::Dataset::DimensionValue
- Defined in:
- lib/mdquery/dataset.rb
Overview
describes a value on a segment of a dimension
Instance Attribute Summary collapse
-
#dimension_segment ⇒ Object
readonly
DimensionSegment this value belongs to.
-
#label ⇒ Object
readonly
Optional label for the value.
-
#value ⇒ Object
readonly
the value.
Instance Method Summary collapse
-
#initialize(dimension_segment, value, label) ⇒ DimensionValue
constructor
A new instance of DimensionValue.
- #inspect ⇒ Object
- #validate ⇒ Object
Constructor Details
#initialize(dimension_segment, value, label) ⇒ DimensionValue
Returns a new instance of DimensionValue.
17 18 19 20 21 22 |
# File 'lib/mdquery/dataset.rb', line 17 def initialize(dimension_segment, value, label) @dimension_segment = dimension_segment @value = value @label = label validate end |
Instance Attribute Details
#dimension_segment ⇒ Object (readonly)
DimensionSegment this value belongs to
9 10 11 |
# File 'lib/mdquery/dataset.rb', line 9 def dimension_segment @dimension_segment end |
#label ⇒ Object (readonly)
Optional label for the value
15 16 17 |
# File 'lib/mdquery/dataset.rb', line 15 def label @label end |
#value ⇒ Object (readonly)
the value
12 13 14 |
# File 'lib/mdquery/dataset.rb', line 12 def value @value end |
Instance Method Details
#inspect ⇒ Object
29 30 31 |
# File 'lib/mdquery/dataset.rb', line 29 def inspect "#<DimensionValue: value=#{value.inspect}, label=#{label.inspect}>" end |
#validate ⇒ Object
24 25 26 27 |
# File 'lib/mdquery/dataset.rb', line 24 def validate raise "no dimension_segment!" if !dimension_segment raise "no value!" if !value end |