Class: Lkml::Tree::PairNode
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- Lkml::Tree::PairNode
- Defined in:
- lib/lkml/tree.rb
Instance Attribute Summary collapse
-
#colon ⇒ Object
readonly
Returns the value of attribute colon.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #accept(visitor) ⇒ Object
- #children ⇒ Object
-
#initialize(type:, value:, colon: nil) ⇒ PairNode
constructor
A new instance of PairNode.
- #inspect ⇒ Object
- #line_number ⇒ Object
- #to_s ⇒ Object
- #with(**changes) ⇒ Object
Constructor Details
Instance Attribute Details
#colon ⇒ Object (readonly)
Returns the value of attribute colon.
182 183 184 |
# File 'lib/lkml/tree.rb', line 182 def colon @colon end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
182 183 184 |
# File 'lib/lkml/tree.rb', line 182 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
182 183 184 |
# File 'lib/lkml/tree.rb', line 182 def value @value end |
Instance Method Details
#==(other) ⇒ Object
220 221 222 223 224 225 |
# File 'lib/lkml/tree.rb', line 220 def ==(other) instance_of?(other.class) && @type == other.type && @value == other.value && @colon == other.colon end |
#accept(visitor) ⇒ Object
204 205 206 |
# File 'lib/lkml/tree.rb', line 204 def accept(visitor) visitor.visit_pair(self) end |
#children ⇒ Object
196 197 198 |
# File 'lib/lkml/tree.rb', line 196 def children nil end |
#inspect ⇒ Object
192 193 194 |
# File 'lib/lkml/tree.rb', line 192 def inspect "#{self.class.name.split('::').last}(type='#{@type.value}', value='#{@value.value}')" end |
#line_number ⇒ Object
200 201 202 |
# File 'lib/lkml/tree.rb', line 200 def line_number @type.line_number end |
#to_s ⇒ Object
208 209 210 |
# File 'lib/lkml/tree.rb', line 208 def to_s Tree.items_to_str(@type, @colon, @value) end |