Class: CTioga2::MetaBuilder::Types::AlignmentType

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

Overview

Vertical alignement

Constant Summary collapse

ValidTypes =
{
  /t(op)?/i => ALIGNED_AT_TOP,
  /c(enter)|m(idheight)/i => ALIGNED_AT_MIDHEIGHT,
  /B|Baseline|baseline/ => ALIGNED_AT_BASELINE,
  /b(ottom)?/ => ALIGNED_AT_BOTTOM
}

Instance Attribute Summary

Attributes inherited from CTioga2::MetaBuilder::Type

#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:



166
167
168
169
170
171
172
173
# File 'lib/ctioga2/metabuilder/types/styles.rb', line 166

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