Class: CTioga2::MetaBuilder::Types::BoxType

Inherits:
CTioga2::MetaBuilder::Type show all
Defined in:
lib/ctioga2/metabuilder/types/coordinates.rb

Overview

A generic class that interfaces known types of boxes. Much fun in perspective.

Instance Attribute Summary

Attributes inherited from CTioga2::MetaBuilder::Type

#namespace, #namespace_lookup, #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



98
99
100
101
102
103
104
105
106
107
108
# File 'lib/ctioga2/metabuilder/types/coordinates.rb', line 98

def string_to_type_internal(str)
  default = @type[:default] || :frame
  case str
  when Graphics::Types::GridBox::GridBoxRE
    return Graphics::Types::GridBox::from_text(str)
  when Graphics::Types::PointBasedBox::PointBasedBoxRE
    return Graphics::Types::PointBasedBox::from_text(str, default)
  else
    raise "Unknown box specification: '#{str}'"
  end
end