Class: GmailSearchSyntax::Token
- Inherits:
-
Object
- Object
- GmailSearchSyntax::Token
- Defined in:
- lib/gmail_search_syntax/tokenizer.rb
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value, position) ⇒ Token
constructor
A new instance of Token.
- #inspect ⇒ Object
- #to_s ⇒ Object
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
#position ⇒ Object (readonly)
Returns the value of attribute position.
3 4 5 |
# File 'lib/gmail_search_syntax/tokenizer.rb', line 3 def position @position end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/gmail_search_syntax/tokenizer.rb', line 3 def type @type end |
#value ⇒ Object (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
#inspect ⇒ Object
15 16 17 |
# File 'lib/gmail_search_syntax/tokenizer.rb', line 15 def inspect {type: @type, value: @value, offset: @position}.inspect end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/gmail_search_syntax/tokenizer.rb', line 11 def to_s inspect end |