Class: Estreet::LabeledStatement

Inherits:
Statement show all
Defined in:
lib/estreet/labeled_statement.rb

Instance Attribute Summary

Attributes inherited from Node

#source_location

Instance Method Summary collapse

Methods inherited from Statement

#<<, #to_statement

Methods inherited from Node

#as_json, #loc, #type

Constructor Details

#initialize(label, body) ⇒ LabeledStatement

Returns a new instance of LabeledStatement.



3
4
5
6
7
# File 'lib/estreet/labeled_statement.rb', line 3

def initialize(label, body)

  @label = Identifier.new(label)
  @body = body.to_statement
end

Instance Method Details

#attributesObject



9
10
11
12
13
14
# File 'lib/estreet/labeled_statement.rb', line 9

def attributes
  super.merge(
    label: @label,
    body: @body
  )
end