Class: Nasl::Token
- Inherits:
-
Object
- Object
- Nasl::Token
- Defined in:
- lib/nasl/token.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#ctx ⇒ Object
readonly
Returns the value of attribute ctx.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #context(*args) ⇒ Object
-
#initialize(type, body, region, ctx) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
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
#body ⇒ Object (readonly)
Returns the value of attribute body.
29 30 31 |
# File 'lib/nasl/token.rb', line 29 def body @body end |
#ctx ⇒ Object (readonly)
Returns the value of attribute ctx.
29 30 31 |
# File 'lib/nasl/token.rb', line 29 def ctx @ctx end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
29 30 31 |
# File 'lib/nasl/token.rb', line 29 def name @name end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
29 30 31 |
# File 'lib/nasl/token.rb', line 29 def region @region end |
#type ⇒ Object (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_s ⇒ Object
65 66 67 |
# File 'lib/nasl/token.rb', line 65 def to_s @body end |