Class: Aspen::CustomGrammar::AST::Nodes::CaptureSegment

Inherits:
Object
  • Object
show all
Defined in:
lib/aspen/custom_grammar/ast/nodes/capture_segment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, var_name:, label:) ⇒ CaptureSegment

Returns a new instance of CaptureSegment.



9
10
11
12
13
# File 'lib/aspen/custom_grammar/ast/nodes/capture_segment.rb', line 9

def initialize(type: , var_name: , label: )
  @type     = type
  @var_name = var_name
  @label    = label
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



7
8
9
# File 'lib/aspen/custom_grammar/ast/nodes/capture_segment.rb', line 7

def label
  @label
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/aspen/custom_grammar/ast/nodes/capture_segment.rb', line 7

def type
  @type
end

#var_nameObject (readonly)

Returns the value of attribute var_name.



7
8
9
# File 'lib/aspen/custom_grammar/ast/nodes/capture_segment.rb', line 7

def var_name
  @var_name
end