Class: SeccompTools::Disasm::Context::Value
- Inherits:
-
Object
- Object
- SeccompTools::Disasm::Context::Value
- Defined in:
- lib/seccomp-tools/disasm/context.rb
Overview
Records the type and value.
Instance Attribute Summary collapse
- #val ⇒ Integer readonly
Instance Method Summary collapse
- #data? ⇒ Boolean
-
#eql?(other) ⇒ Boolean
Defines
eql?. -
#hash ⇒ Integer
Defines hash function.
- #imm? ⇒ Boolean
-
#initialize(rel: :imm, val: nil) ⇒ Value
constructor
A new instance of Value.
Constructor Details
#initialize(rel: :imm, val: nil) ⇒ Value
Returns a new instance of Value.
21 22 23 24 |
# File 'lib/seccomp-tools/disasm/context.rb', line 21 def initialize(rel: :imm, val: nil) @rel = rel @val = val end |
Instance Attribute Details
#val ⇒ Integer (readonly)
17 18 19 |
# File 'lib/seccomp-tools/disasm/context.rb', line 17 def val @val end |
Instance Method Details
#data? ⇒ Boolean
27 28 29 |
# File 'lib/seccomp-tools/disasm/context.rb', line 27 def data? @rel == :data end |
#eql?(other) ⇒ Boolean
Defines eql?.
46 47 48 |
# File 'lib/seccomp-tools/disasm/context.rb', line 46 def eql?(other) @val == other.val && @rel == other.instance_variable_get(:@rel) end |
#hash ⇒ Integer
Defines hash function.
38 39 40 |
# File 'lib/seccomp-tools/disasm/context.rb', line 38 def hash @rel.hash ^ @val.hash end |
#imm? ⇒ Boolean
32 33 34 |
# File 'lib/seccomp-tools/disasm/context.rb', line 32 def imm? @rel == :imm && @val.is_a?(Integer) end |