Class: Nasl::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/nasl/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, body, region, ctx) ⇒ Token

Returns a new instance of Token.



31
32
33
34
35
36
# File 'lib/nasl/token.rb', line 31

def initialize(type, body, region, ctx)
  @type = type
  @body = body
  @region = region
  @ctx = ctx
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



29
30
31
# File 'lib/nasl/token.rb', line 29

def body
  @body
end

#ctxObject (readonly)

Returns the value of attribute ctx.



29
30
31
# File 'lib/nasl/token.rb', line 29

def ctx
  @ctx
end

#nameObject (readonly)

Returns the value of attribute name.



29
30
31
# File 'lib/nasl/token.rb', line 29

def name
  @name
end

#regionObject (readonly)

Returns the value of attribute region.



29
30
31
# File 'lib/nasl/token.rb', line 29

def region
  @region
end

#typeObject (readonly)

Returns the value of attribute type.



29
30
31
# File 'lib/nasl/token.rb', line 29

def type
  @type
end

Instance Method Details

#context(*args) ⇒ Object



38
39
40
# File 'lib/nasl/token.rb', line 38

def context(*args)
  @ctx.context(@region, *args)
end

#to_sObject



66
67
68
# File 'lib/nasl/token.rb', line 66

def to_s
  @body
end