class CTioga2::MetaBuilder::Types::LineStyleType

A line style for Tioga. It will be represented as:

a,b,c,d,...:e

This creates a line style of:

[[a,b,c,d,...],e]

If the :e is omitted 0 is used.

Public Instance Methods

string_to_type_internal(str) click to toggle source
# File lib/ctioga2/metabuilder/types/styles.rb, line 106
def string_to_type_internal(str)
  specs = str.split(/\s*,\s*/)
  if specs.last =~ /:(.*)$/
    phase = $1.to_f
    specs.last.gsub!(/:.*$/,'')
  else
    phase = 0
  end
  return [ specs.map { |s| 
             s = s.gsub(/\.\s*$/, '.0')
             s = s.gsub(/^\s*\./, '0.')
             Float(s)
           }, phase]
end