Class: Nasl::Object
- Includes:
- Enumerable
- Defined in:
- lib/nasl/parser/object.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) ⇒ Object
constructor
A new instance of Object.
Methods inherited from Node
Constructor Details
#initialize(tree, *tokens) ⇒ Object
Returns a new instance of Object.
35 36 37 38 39 40 41 42 43 |
# File 'lib/nasl/parser/object.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/object.rb', line 31 def body @body end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/nasl/parser/object.rb', line 31 def name @name end |
Instance Method Details
#each ⇒ Object
45 46 47 |
# File 'lib/nasl/parser/object.rb', line 45 def each @body.each{ |stmt| yield stmt } end |