Class: Attentive::Tokens::Whitespace

Inherits:
StringToken show all
Defined in:
lib/attentive/tokens/whitespace.rb

Instance Attribute Summary

Attributes inherited from StringToken

#string

Attributes inherited from Attentive::Token

#begin

Instance Method Summary collapse

Methods inherited from StringToken

#eql?, #hash, #initialize, #length, #to_s, #to_str

Methods inherited from Attentive::Token

#ambiguous?, #end, #entity?, #eof?, #initialize, #inspect, #matches?

Constructor Details

This class inherits a constructor from Attentive::StringToken

Instance Method Details

#==(other) ⇒ Object

All whitespace is equal



8
9
10
# File 'lib/attentive/tokens/whitespace.rb', line 8

def ==(other)
  self.class == other.class
end

#skippable?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/attentive/tokens/whitespace.rb', line 12

def skippable?
  true
end

#whitespace?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/attentive/tokens/whitespace.rb', line 16

def whitespace?
  true
end