Class: Nasl::Decrement

Inherits:
Node
  • Object
show all
Defined in:
lib/nasl/parser/decrement.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#ctx, #tokens

Instance Method Summary collapse

Methods inherited from Node

#context, #region, #to_xml

Constructor Details

#initialize(tree, *tokens) ⇒ Decrement

Returns a new instance of Decrement.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/nasl/parser/decrement.rb', line 33

def initialize(tree, *tokens)
  super

  if @tokens.first.is_a? Lvalue
    @type = :post
    @ident = @tokens[0]
  else
    @type = :pre
    @ident = @tokens[1]
  end

  @attributes << :ident
  @attributes << :type
end

Instance Attribute Details

#identObject (readonly)

Returns the value of attribute ident.



31
32
33
# File 'lib/nasl/parser/decrement.rb', line 31

def ident
  @ident
end

#typeObject (readonly)

Returns the value of attribute type.



31
32
33
# File 'lib/nasl/parser/decrement.rb', line 31

def type
  @type
end