Class: MarshalParser::Parser::ArrayNode
- Defined in:
- lib/marshal-parser/parser.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #child_entities ⇒ Object
-
#initialize(marker_token, length_token, elements_nodes) ⇒ ArrayNode
constructor
A new instance of ArrayNode.
Methods inherited from Node
#always_leaf?, #children, #decoded_value, #literal_token, #tokens
Methods included from Assertable
Constructor Details
#initialize(marker_token, length_token, elements_nodes) ⇒ ArrayNode
Returns a new instance of ArrayNode.
314 315 316 317 318 319 320 321 322 |
# File 'lib/marshal-parser/parser.rb', line 314 def initialize(marker_token, length_token, elements_nodes) super() assert_token_type marker_token, Lexer::ARRAY_PREFIX assert_token_type length_token, Lexer::INTEGER @marker_token = marker_token @length_token = length_token @elements_nodes = elements_nodes end |
Instance Method Details
#attributes ⇒ Object
328 329 330 331 332 |
# File 'lib/marshal-parser/parser.rb', line 328 def attributes { @length_token => { name: :length, value: @length_token.value } } end |
#child_entities ⇒ Object
324 325 326 |
# File 'lib/marshal-parser/parser.rb', line 324 def child_entities [@marker_token, @length_token] + @elements_nodes end |