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