Class: GmailSearchSyntax::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/gmail_search_syntax/tokenizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value, position) ⇒ Token



5
6
7
8
9
# File 'lib/gmail_search_syntax/tokenizer.rb', line 5

def initialize(type, value, position)
  @type = type
  @value = value
  @position = position
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



3
4
5
# File 'lib/gmail_search_syntax/tokenizer.rb', line 3

def position
  @position
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/gmail_search_syntax/tokenizer.rb', line 3

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/gmail_search_syntax/tokenizer.rb', line 3

def value
  @value
end

Instance Method Details

#inspectObject



15
16
17
# File 'lib/gmail_search_syntax/tokenizer.rb', line 15

def inspect
  {type: @type, value: @value, offset: @position}.inspect
end

#to_sObject



11
12
13
# File 'lib/gmail_search_syntax/tokenizer.rb', line 11

def to_s
  inspect
end