Class: Nasl::Call
Instance Attribute Summary collapse
-
#arg ⇒ Object
readonly
Returns the value of attribute arg.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(tree, *tokens) ⇒ Call
constructor
A new instance of Call.
Methods inherited from Node
Constructor Details
#initialize(tree, *tokens) ⇒ Call
Returns a new instance of Call.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/nasl/parser/call.rb', line 33 def initialize(tree, *tokens) super @name = @tokens[0] @args = if @tokens[2].is_a? ::Array then @tokens[2] else [] end @arg = {} @args.select { |a| a.type == :named }.each do |a| @arg[a.name.name] = a.expr end @children << :name @children << :args end |
Instance Attribute Details
#arg ⇒ Object (readonly)
Returns the value of attribute arg.
31 32 33 |
# File 'lib/nasl/parser/call.rb', line 31 def arg @arg end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
31 32 33 |
# File 'lib/nasl/parser/call.rb', line 31 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/nasl/parser/call.rb', line 31 def name @name end |