class Dim

Definition of a dimension (structure: from-to)

Author

Massimiliano Dal Mas (max.codeware@gmail.com)

License

Distributed under MIT license

Public Class Methods

new(str) click to toggle source
  • *argument*: string to be converted to a dimension

# File lib/linmeric/CnGal_new_classes.rb, line 311
def initialize(str)
  str = str - '"'
  str = str.split(',')
  if str.size == 2 and str[0] != "" and str[1] != "" then
    str.each do |val|
      puts '  Argument Error: wrong range format' unless val.number?
    end
    @sx = str[0].to_n
    @dx = str[1].to_n
  else
    puts '  Argument Error: wrong range format'
  end
end

Public Instance Methods

dx() click to toggle source
  • *returns*: right dimension value

# File lib/linmeric/CnGal_new_classes.rb, line 331
def dx()
  return @dx
end
sx() click to toggle source
  • *returns*: left dimension value

# File lib/linmeric/CnGal_new_classes.rb, line 326
def sx()
  return @sx
end