Class: Nasl::Argument
Instance Attribute Summary collapse
-
#expr ⇒ Object
readonly
Returns the value of attribute expr.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(tree, *tokens) ⇒ Argument
constructor
A new instance of Argument.
Methods inherited from Node
Constructor Details
#initialize(tree, *tokens) ⇒ Argument
Returns a new instance of Argument.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/nasl/parser/argument.rb', line 33 def initialize(tree, *tokens) super if @tokens.length == 3 @name = @tokens.first @expr = @tokens.last @type = :named else @name = nil @expr = @tokens.first @type = :anonymous end @attributes << :type @children << :name @children << :expr end |
Instance Attribute Details
#expr ⇒ Object (readonly)
Returns the value of attribute expr.
31 32 33 |
# File 'lib/nasl/parser/argument.rb', line 31 def expr @expr end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/nasl/parser/argument.rb', line 31 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
31 32 33 |
# File 'lib/nasl/parser/argument.rb', line 31 def type @type end |