Class: Nasl::FunctionReference
- Defined in:
- lib/nasl/parser/function_ref.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Attributes inherited from Node
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(tree, *tokens) ⇒ FunctionReference
constructor
A new instance of FunctionReference.
Methods inherited from Node
Constructor Details
#initialize(tree, *tokens) ⇒ FunctionReference
Returns a new instance of FunctionReference.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/nasl/parser/function_ref.rb', line 33 def initialize(tree, *tokens) super @body = @tokens.last if @tokens.length == 5 @params = @tokens[0] else @params = [] end @children << :params @children << :body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
31 32 33 |
# File 'lib/nasl/parser/function_ref.rb', line 31 def body @body end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
31 32 33 |
# File 'lib/nasl/parser/function_ref.rb', line 31 def params @params end |
Instance Method Details
#each ⇒ Object
48 49 50 |
# File 'lib/nasl/parser/function_ref.rb', line 48 def each @body.each{ |stmt| yield stmt } end |