Class: SeccompTools::Asm::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/seccomp-tools/asm/token.rb

Overview

Records information of a token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sym, str, line, col) ⇒ Token

Instantiates a SeccompTools::Asm::Token object.

Parameters:

  • sym (Symbol)
  • str (String)
  • line (Integer)
  • col (Integer)


14
15
16
17
18
19
# File 'lib/seccomp-tools/asm/token.rb', line 14

def initialize(sym, str, line, col)
  @sym = sym
  @str = str
  @line = line
  @col = col
end

Instance Attribute Details

#colObject (readonly)

Returns the value of attribute col.



7
8
9
# File 'lib/seccomp-tools/asm/token.rb', line 7

def col
  @col
end

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/seccomp-tools/asm/token.rb', line 7

def line
  @line
end

#strObject (readonly)

Returns the value of attribute str.



7
8
9
# File 'lib/seccomp-tools/asm/token.rb', line 7

def str
  @str
end

#symObject (readonly)

Returns the value of attribute sym.



7
8
9
# File 'lib/seccomp-tools/asm/token.rb', line 7

def sym
  @sym
end

Instance Method Details

#==(other) ⇒ Boolean

To compare with another SeccompTools::Asm::Token object.

Parameters:

Returns:

  • (Boolean)


24
25
26
# File 'lib/seccomp-tools/asm/token.rb', line 24

def ==(other)
  [other.sym, other.str, other.line, other.col] == [sym, str, line, col]
end