Class: RubyJsonParser::AST::StringLiteralNode
- Defined in:
- lib/ruby_json_parser/ast.rb
Overview
Represents a string literal eg. ‘“foo”`
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ StringLiteralNode
constructor
A new instance of StringLiteralNode.
- #inspect(indent = 0) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ StringLiteralNode
Returns a new instance of StringLiteralNode.
144 145 146 |
# File 'lib/ruby_json_parser/ast.rb', line 144 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
141 142 143 |
# File 'lib/ruby_json_parser/ast.rb', line 141 def value @value end |
Instance Method Details
#==(other) ⇒ Object
149 150 151 152 153 |
# File 'lib/ruby_json_parser/ast.rb', line 149 def ==(other) return false unless other.is_a?(StringLiteralNode) value == other.value end |
#inspect(indent = 0) ⇒ Object
161 162 163 |
# File 'lib/ruby_json_parser/ast.rb', line 161 def inspect(indent = 0) "#{INDENT_UNIT * indent}#{value.inspect}" end |
#to_s ⇒ Object
156 157 158 |
# File 'lib/ruby_json_parser/ast.rb', line 156 def to_s value.inspect end |