Class: RubyJsonParser::AST::InvalidNode
- Defined in:
- lib/ruby_json_parser/ast.rb
Overview
Represents an invalid node
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(token) ⇒ InvalidNode
constructor
A new instance of InvalidNode.
- #inspect(indent = 0) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(token) ⇒ InvalidNode
Returns a new instance of InvalidNode.
34 35 36 |
# File 'lib/ruby_json_parser/ast.rb', line 34 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
31 32 33 |
# File 'lib/ruby_json_parser/ast.rb', line 31 def token @token end |
Instance Method Details
#==(other) ⇒ Object
39 40 41 42 43 |
# File 'lib/ruby_json_parser/ast.rb', line 39 def ==(other) return false unless other.is_a?(InvalidNode) token == other.token end |
#inspect(indent = 0) ⇒ Object
51 52 53 |
# File 'lib/ruby_json_parser/ast.rb', line 51 def inspect(indent = 0) "#{INDENT_UNIT * indent}(invalid `#{token}`)" end |
#to_s ⇒ Object
46 47 48 |
# File 'lib/ruby_json_parser/ast.rb', line 46 def to_s "<invalid: `#{token}`>" end |