class Ecu class Festwert < Label def self.dcm_header %r{FESTWERT\s+(?[A-Za-z0-9\._]+)} end def to_dcm "#{type.upcase} #{name}\n".tap do |str| str << " LANGNAME #{description.enquote}\n" if description str << " FUNKTION #{function}\n" if function str << " EINHEIT_W #{unit.enquote}\n" if unit str << case value when Numeric then " WERT #{value}\n" when String then " TEXT #{value.enquote}\n" end str << "END\n" end end end end