Class: Nasl::Function
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.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(tree, *tokens) ⇒ Function
constructor
A new instance of Function.
Methods inherited from Node
Constructor Details
#initialize(tree, *tokens) ⇒ Function
Returns a new instance of Function.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/nasl/parser/function.rb', line 33 def initialize(tree, *tokens) super @name = @tokens[1] @params = if @tokens.length == 6 then @tokens[3] else [] end @body = @tokens.last @children << :name @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.rb', line 31 def body @body end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/nasl/parser/function.rb', line 31 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
31 32 33 |
# File 'lib/nasl/parser/function.rb', line 31 def params @params end |