module Attentive::Tokens

Public Instance Methods

any_of(string, possibilities, pos: nil) click to toggle source
# File lib/attentive/tokens.rb, line 4
def any_of(string, possibilities, pos: nil)
  Attentive::Tokens::AnyOf.new string, possibilities, pos
end
emoji(string, pos: nil) click to toggle source
# File lib/attentive/tokens.rb, line 8
def emoji(string, pos: nil)
  Attentive::Tokens::Emoji.new string, pos
end
entity(string, pos: nil) click to toggle source
# File lib/attentive/tokens.rb, line 12
def entity(string, pos: nil)
  entity_name, variable_name = *string.split(":").reverse
  Attentive::Entity[entity_name.to_sym].new(variable_name || entity_name)
end
invocation(string, pos: nil) click to toggle source
# File lib/attentive/tokens.rb, line 17
def invocation(string, pos: nil)
  Attentive::Tokens::Invocation.new string, pos
end
punctuation(string, pos: nil) click to toggle source
# File lib/attentive/tokens.rb, line 21
def punctuation(string, pos: nil)
  Attentive::Tokens::Punctuation.new string, pos
end
regexp(string, pos: nil) click to toggle source
# File lib/attentive/tokens.rb, line 25
def regexp(string, pos: nil)
  Attentive::Tokens::Regexp.new string, pos
end
whitespace(string, pos: nil) click to toggle source
# File lib/attentive/tokens.rb, line 29
def whitespace(string, pos: nil)
  Attentive::Tokens::Whitespace.new string, pos
end
word(string, pos: nil) click to toggle source
# File lib/attentive/tokens.rb, line 33
def word(string, pos: nil)
  Attentive::Tokens::Word.new string, pos
end