Class: DataMetaDom::DimInfo
- Inherits:
-
Object
- Object
- DataMetaDom::DimInfo
- Defined in:
- lib/dataMetaDom.rb
Overview
Simplest diminfo to be reused wherever no other aspect of a datatype is needed
Constant Summary collapse
- NIL =
Convenience constant - NIL dimension to use in the types that are not dimensioned.
DimInfo.new(nil, nil)
Instance Attribute Summary collapse
-
#len ⇒ Fixnum
readonly
The Length part of the dimension info.
-
#scale ⇒ Fixnum
readonly
The Scale part of the dimension info.
Instance Method Summary collapse
-
#initialize(len, scale) ⇒ DimInfo
constructor
Creates an instance with the given parameters.
-
#to_s ⇒ Object
Textual representation of this instance, length.scale.
Constructor Details
#initialize(len, scale) ⇒ DimInfo
Creates an instance with the given parameters
107 |
# File 'lib/dataMetaDom.rb', line 107 def initialize(len, scale); @len = len; @scale = scale end |
Instance Attribute Details
#len ⇒ Fixnum (readonly)
Returns the Length part of the dimension info.
102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/dataMetaDom.rb', line 102 class DimInfo attr_reader :len, :scale # Creates an instance with the given parameters def initialize(len, scale); @len = len; @scale = scale end # Textual representation of this instance, length.scale def to_s; "#{@len}.#{@scale}" end # Convenience constant - NIL dimension to use in the types that are not dimensioned. NIL=DimInfo.new(nil, nil) end |
#scale ⇒ Fixnum (readonly)
Returns the Scale part of the dimension info.
102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/dataMetaDom.rb', line 102 class DimInfo attr_reader :len, :scale # Creates an instance with the given parameters def initialize(len, scale); @len = len; @scale = scale end # Textual representation of this instance, length.scale def to_s; "#{@len}.#{@scale}" end # Convenience constant - NIL dimension to use in the types that are not dimensioned. NIL=DimInfo.new(nil, nil) end |
Instance Method Details
#to_s ⇒ Object
Textual representation of this instance, length.scale
110 |
# File 'lib/dataMetaDom.rb', line 110 def to_s; "#{@len}.#{@scale}" end |