Class: Rjq::AST::FunctionDefinition
- Inherits:
-
Object
- Object
- Rjq::AST::FunctionDefinition
- Defined in:
- lib/rjq/ast.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#closure ⇒ Object
readonly
Returns the value of attribute closure.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(name, params, body, closure = nil) ⇒ FunctionDefinition
constructor
A new instance of FunctionDefinition.
- #with_closure(functions) ⇒ Object
Constructor Details
#initialize(name, params, body, closure = nil) ⇒ FunctionDefinition
Returns a new instance of FunctionDefinition.
129 130 131 132 133 134 |
# File 'lib/rjq/ast.rb', line 129 def initialize(name, params, body, closure = nil) @name = name @params = params @body = body @closure = closure end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
127 128 129 |
# File 'lib/rjq/ast.rb', line 127 def body @body end |
#closure ⇒ Object (readonly)
Returns the value of attribute closure.
127 128 129 |
# File 'lib/rjq/ast.rb', line 127 def closure @closure end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
127 128 129 |
# File 'lib/rjq/ast.rb', line 127 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
127 128 129 |
# File 'lib/rjq/ast.rb', line 127 def params @params end |
Instance Method Details
#with_closure(functions) ⇒ Object
136 137 138 |
# File 'lib/rjq/ast.rb', line 136 def with_closure(functions) self.class.new(name, params, body, functions) end |