Class: SeccompTools::Asm::Scalar::Data

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

Overview

A data[] access, one word of struct seccomp_data.

Instance Attribute Summary

Attributes inherited from Base

#val

Instance Method Summary collapse

Methods inherited from Base

#a?, #const?, #len?, #mem?, #x?

Constructor Details

#initialize(index) ⇒ Data

Instantiates a SeccompTools::Asm::Scalar::Data object.

Parameters:

  • index (Integer)

    Byte offset into struct seccomp_data.



127
128
129
130
# File 'lib/seccomp-tools/asm/scalar.rb', line 127

def initialize(index)
  @val = index
  super()
end

Instance Method Details

#==(other) ⇒ Boolean

Returns true only if other is a SeccompTools::Asm::Scalar::Data with the same index.

Parameters:

  • other (Data)

    The object to be compared with.

Returns:



136
137
138
# File 'lib/seccomp-tools/asm/scalar.rb', line 136

def ==(other)
  other.is_a?(Data) && val == other.val
end

#data?Boolean

Returns Always true.

Returns:

  • (Boolean)

    Always true.



141
142
143
# File 'lib/seccomp-tools/asm/scalar.rb', line 141

def data?
  true
end