Class: CTioga::Styles::CTiogaLineStyleParameter
- Inherits:
-
MetaBuilder::ParameterType
- Object
- MetaBuilder::ParameterType
- CTioga::Styles::CTiogaLineStyleParameter
- Defined in:
- lib/CTioga/styles.rb
Instance Method Summary collapse
Methods inherited from MetaBuilder::ParameterType
#default_value, from_string, get_param_type, get_type, #initialize, #lookup_const, #option_parser_long_option, #option_parser_option, #option_parser_raw, #qt4_create_input_widget, #qt4_get, #string_to_type, #stt_run_hook, #type_name, type_name, #type_to_string, #type_to_variant, #variant_to_type
Constructor Details
This class inherits a constructor from MetaBuilder::ParameterType
Instance Method Details
#string_to_type_internal(str) ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/CTioga/styles.rb', line 115 def string_to_type_internal(str) if str =~ /(:?\d+\s*,)+/ ar = str.split(/\s*,\s*/).map{|v| v.to_f} if ar.size % 2 == 0 return [ar, 0] else last = ar.pop return [ar, last] end elsif Tioga::FigureConstants.const_defined?(str) return Tioga::FigureConstants.const_get(str) elsif Styles.const_defined?(str) return Styles.const_get(str) else raise IncorrectInput, "'#{str}' is not a valid line type" end end |
#type_to_string_internal(val) ⇒ Object
133 134 135 |
# File 'lib/CTioga/styles.rb', line 133 def type_to_string_internal(val) return val.flatten.map {|i| i.to_s}.join(',') end |