Class: JSON5::MemberNode
Instance Attribute Summary collapse
-
#colon_end_byte ⇒ Object
readonly
Returns the value of attribute colon_end_byte.
-
#colon_leading_trivia ⇒ Object
readonly
Returns the value of attribute colon_leading_trivia.
-
#colon_span ⇒ Object
readonly
Returns the value of attribute colon_span.
-
#colon_start_byte ⇒ Object
readonly
Returns the value of attribute colon_start_byte.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Node
#end_byte, #leading_trivia, #raw_span, #source, #start_byte, #trailing_trivia, #type
Instance Method Summary collapse
-
#initialize(name:, value:, colon_start_byte:, colon_end_byte:, colon_leading_trivia: [], **attributes) ⇒ MemberNode
constructor
A new instance of MemberNode.
Methods inherited from Node
Constructor Details
#initialize(name:, value:, colon_start_byte:, colon_end_byte:, colon_leading_trivia: [], **attributes) ⇒ MemberNode
Returns a new instance of MemberNode.
70 71 72 73 74 75 76 77 78 |
# File 'lib/json5/document_nodes.rb', line 70 def initialize(name:, value:, colon_start_byte:, colon_end_byte:, colon_leading_trivia: [], **attributes) @name = name @value = value @colon_start_byte = colon_start_byte @colon_end_byte = colon_end_byte @colon_span = ByteSpan.new(colon_start_byte, colon_end_byte) @colon_leading_trivia = colon_leading_trivia.dup.freeze super(type: :member, **attributes) end |
Instance Attribute Details
#colon_end_byte ⇒ Object (readonly)
Returns the value of attribute colon_end_byte.
68 69 70 |
# File 'lib/json5/document_nodes.rb', line 68 def colon_end_byte @colon_end_byte end |
#colon_leading_trivia ⇒ Object (readonly)
Returns the value of attribute colon_leading_trivia.
68 69 70 |
# File 'lib/json5/document_nodes.rb', line 68 def colon_leading_trivia @colon_leading_trivia end |
#colon_span ⇒ Object (readonly)
Returns the value of attribute colon_span.
68 69 70 |
# File 'lib/json5/document_nodes.rb', line 68 def colon_span @colon_span end |
#colon_start_byte ⇒ Object (readonly)
Returns the value of attribute colon_start_byte.
68 69 70 |
# File 'lib/json5/document_nodes.rb', line 68 def colon_start_byte @colon_start_byte end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
68 69 70 |
# File 'lib/json5/document_nodes.rb', line 68 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
68 69 70 |
# File 'lib/json5/document_nodes.rb', line 68 def value @value end |