Class: Baba::Stmt::Function
- Inherits:
-
Object
- Object
- Baba::Stmt::Function
- Defined in:
- lib/baba/stmt.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(name, params, body) ⇒ Function
constructor
A new instance of Function.
Constructor Details
#initialize(name, params, body) ⇒ Function
Returns a new instance of Function.
42 43 44 |
# File 'lib/baba/stmt.rb', line 42 def initialize(name, params, body) @name = name; @params = params; @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
40 41 42 |
# File 'lib/baba/stmt.rb', line 40 def body @body end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40 41 42 |
# File 'lib/baba/stmt.rb', line 40 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
40 41 42 |
# File 'lib/baba/stmt.rb', line 40 def params @params end |
Instance Method Details
#accept(visitor) ⇒ Object
46 47 48 |
# File 'lib/baba/stmt.rb', line 46 def accept(visitor) visitor.visit_function_stmt(self) end |