Class: Nasl::Switch
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#switch_expr ⇒ Object
readonly
Returns the value of attribute switch_expr.
-
#switch_op ⇒ Object
readonly
Returns the value of attribute switch_op.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(tree, *tokens) ⇒ Switch
constructor
A new instance of Switch.
Methods inherited from Node
Constructor Details
#initialize(tree, *tokens) ⇒ Switch
Returns a new instance of Switch.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/nasl/parser/switch.rb', line 33 def initialize(tree, *tokens) super if @tokens.length == 5 @switch_op = nil @switch_expr = @tokens[2] @body = @tokens[4] else @switch_op = @tokens[2] @switch_expr = @tokens[5] @body = @tokens[7] end @children << :switch_op @children << :switch_expr @children << :body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
31 32 33 |
# File 'lib/nasl/parser/switch.rb', line 31 def body @body end |
#switch_expr ⇒ Object (readonly)
Returns the value of attribute switch_expr.
31 32 33 |
# File 'lib/nasl/parser/switch.rb', line 31 def switch_expr @switch_expr end |
#switch_op ⇒ Object (readonly)
Returns the value of attribute switch_op.
31 32 33 |
# File 'lib/nasl/parser/switch.rb', line 31 def switch_op @switch_op end |