Class: Lkml::Tree::DocumentNode
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- Lkml::Tree::DocumentNode
- Defined in:
- lib/lkml/tree.rb
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#suffix ⇒ Object
readonly
Returns the value of attribute suffix.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #children ⇒ Object
-
#initialize(container, prefix = "", suffix = "") ⇒ DocumentNode
constructor
A new instance of DocumentNode.
- #line_number ⇒ Object
- #to_s ⇒ Object
- #with(**changes) ⇒ Object
Constructor Details
#initialize(container, prefix = "", suffix = "") ⇒ DocumentNode
Returns a new instance of DocumentNode.
412 413 414 415 416 417 418 |
# File 'lib/lkml/tree.rb', line 412 def initialize(container, prefix = "", suffix = "") super() @container = container @prefix = prefix @suffix = suffix freeze end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
410 411 412 |
# File 'lib/lkml/tree.rb', line 410 def container @container end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
410 411 412 |
# File 'lib/lkml/tree.rb', line 410 def prefix @prefix end |
#suffix ⇒ Object (readonly)
Returns the value of attribute suffix.
410 411 412 |
# File 'lib/lkml/tree.rb', line 410 def suffix @suffix end |
Instance Method Details
#accept(visitor) ⇒ Object
428 429 430 |
# File 'lib/lkml/tree.rb', line 428 def accept(visitor) visitor.visit(self) end |
#children ⇒ Object
420 421 422 |
# File 'lib/lkml/tree.rb', line 420 def children [@container] end |
#line_number ⇒ Object
424 425 426 |
# File 'lib/lkml/tree.rb', line 424 def line_number 1 end |
#to_s ⇒ Object
432 433 434 |
# File 'lib/lkml/tree.rb', line 432 def to_s Tree.items_to_str(@prefix, @container, @suffix) end |
#with(**changes) ⇒ Object
436 437 438 439 440 441 442 |
# File 'lib/lkml/tree.rb', line 436 def with(**changes) DocumentNode.new( changes.fetch(:container, @container), changes.fetch(:prefix, @prefix), changes.fetch(:suffix, @suffix) ) end |