Method: Tml::Tokens::Data#parse_elements

Defined in:
lib/tml/tokens/data.rb

#parse_elementsObject



57
58
59
60
61
62
63
64
65
# File 'lib/tml/tokens/data.rb', line 57

def parse_elements
  name_without_parens = @full_name.gsub(/^%/, '')[1..-2]
  name_without_parens = @full_name.gsub(/^%/, '')[1..-2]
  name_without_case_keys = name_without_parens.split('::').first.strip

  @short_name = name_without_parens.split(':').first.strip
  @case_keys = name_without_parens.scan(/(::\w+)/).flatten.uniq.collect{|c| c.gsub('::', '')}
  @context_keys = name_without_case_keys.scan(/(:\w+)/).flatten.uniq.collect{|c| c.gsub(':', '')}
end