Class: CTioga2::MetaBuilder::Types::AxisType

Inherits:
CTioga2::MetaBuilder::Type show all
Includes:
Tioga::FigureConstants
Defined in:
lib/ctioga2/metabuilder/types/styles.rb

Overview

The type of edges/axis

Constant Summary collapse

ValidTypes =
{
  /hidden|off/i => AXIS_HIDDEN,
  /line/i => AXIS_LINE_ONLY, 
  /ticks/i => AXIS_WITH_TICKS_ONLY,
  /major/i => AXIS_WITH_MAJOR_TICKS_ONLY, 
  /major-num/i => AXIS_WITH_MAJOR_TICKS_AND_NUMERIC_LABELS,
  /full/i => AXIS_WITH_TICKS_AND_NUMERIC_LABELS
}

Instance Attribute Summary

Attributes inherited from CTioga2::MetaBuilder::Type

#passthrough, #re_shortcuts, #shortcuts, #type

Instance Method Summary collapse

Methods inherited from CTioga2::MetaBuilder::Type

#boolean?, #default_value, from_string, get_param_type, get_type, #initialize, #option_parser_long_option, #option_parser_option, #string_to_type, #type_name, type_name, #type_to_string

Constructor Details

This class inherits a constructor from CTioga2::MetaBuilder::Type

Instance Method Details

#string_to_type_internal(str) ⇒ Object

Raises:



129
130
131
132
133
134
135
136
# File 'lib/ctioga2/metabuilder/types/styles.rb', line 129

def string_to_type_internal(str)
  for k,v in ValidTypes
    if str =~ /^\s*#{k}\s*/
        return v
    end
  end
  raise IncorrectInput, "Not an axis type: #{str}"
end