Method: Dim#initialize

Defined in:
lib/linmeric/CnGal_new_classes.rb

#initialize(str) ⇒ Dim

  • argument: string to be converted to a dimension



311
312
313
314
315
316
317
318
319
320
321
322
323
# 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