Class: DataMetaDom::DimInfo

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#lenFixnum (readonly)

Returns the Length part of the dimension info.

Returns:

  • (Fixnum)

    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

#scaleFixnum (readonly)

Returns the Scale part of the dimension info.

Returns:

  • (Fixnum)

    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_sObject

Textual representation of this instance, length.scale



110
# File 'lib/dataMetaDom.rb', line 110

def to_s; "#{@len}.#{@scale}" end