Class: Python::Pickle::Instruction
- Inherits:
-
Object
- Object
- Python::Pickle::Instruction
- Defined in:
- lib/python/pickle/instruction.rb
Direct Known Subclasses
Python::Pickle::Instructions::AddItems, Python::Pickle::Instructions::Append, Python::Pickle::Instructions::Appends, Python::Pickle::Instructions::BinBytes, Python::Pickle::Instructions::BinBytes8, Python::Pickle::Instructions::BinFloat, Python::Pickle::Instructions::BinGet, Python::Pickle::Instructions::BinInt1, Python::Pickle::Instructions::BinPersID, Python::Pickle::Instructions::BinPut, Python::Pickle::Instructions::BinString, Python::Pickle::Instructions::BinUnicode, Python::Pickle::Instructions::BinUnicode8, Python::Pickle::Instructions::Build, Python::Pickle::Instructions::ByteArray8, Python::Pickle::Instructions::Dict, Python::Pickle::Instructions::Dup, Python::Pickle::Instructions::EmptyDict, Python::Pickle::Instructions::EmptyList, Python::Pickle::Instructions::EmptySet, Python::Pickle::Instructions::EmptyTuple, Python::Pickle::Instructions::Ext1, Python::Pickle::Instructions::Ext2, Python::Pickle::Instructions::Ext4, Python::Pickle::Instructions::Float, Python::Pickle::Instructions::Frame, Python::Pickle::Instructions::FrozenSet, Python::Pickle::Instructions::Get, Python::Pickle::Instructions::Global, Python::Pickle::Instructions::Inst, Python::Pickle::Instructions::Int, Python::Pickle::Instructions::List, Python::Pickle::Instructions::Long, Python::Pickle::Instructions::Long1, Python::Pickle::Instructions::Long4, Python::Pickle::Instructions::LongBinGet, Python::Pickle::Instructions::Mark, Python::Pickle::Instructions::Memoize, Python::Pickle::Instructions::NewFalse, Python::Pickle::Instructions::NewObj, Python::Pickle::Instructions::NewObjEx, Python::Pickle::Instructions::NewTrue, Python::Pickle::Instructions::NextBuffer, Python::Pickle::Instructions::None, Python::Pickle::Instructions::Obj, Python::Pickle::Instructions::PersID, Python::Pickle::Instructions::Pop, Python::Pickle::Instructions::PopMark, Python::Pickle::Instructions::Proto, Python::Pickle::Instructions::Put, Python::Pickle::Instructions::ReadonlyBuffer, Python::Pickle::Instructions::Reduce, Python::Pickle::Instructions::SetItem, Python::Pickle::Instructions::SetItems, Python::Pickle::Instructions::ShortBinBytes, Python::Pickle::Instructions::ShortBinString, Python::Pickle::Instructions::ShortBinUnicode, Python::Pickle::Instructions::StackGlobal, Python::Pickle::Instructions::Stop, Python::Pickle::Instructions::String, Python::Pickle::Instructions::Tuple, Python::Pickle::Instructions::Tuple1, Python::Pickle::Instructions::Tuple2, Python::Pickle::Instructions::Tuple3
Instance Attribute Summary collapse
-
#opcode ⇒ Symbol
readonly
The opcode name.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compares the instruction to another instruction.
-
#initialize(opcode) ⇒ Instruction
constructor
Initializes the instruction.
-
#inspect ⇒ String
Inspects the instruction.
-
#to_s ⇒ String
Converts the instruction into a String.
Constructor Details
#initialize(opcode) ⇒ Instruction
Initializes the instruction.
15 16 17 |
# File 'lib/python/pickle/instruction.rb', line 15 def initialize(opcode) @opcode = opcode end |
Instance Attribute Details
#opcode ⇒ Symbol (readonly)
The opcode name.
8 9 10 |
# File 'lib/python/pickle/instruction.rb', line 8 def opcode @opcode end |
Instance Method Details
#==(other) ⇒ Boolean
Compares the instruction to another instruction.
28 29 30 |
# File 'lib/python/pickle/instruction.rb', line 28 def ==(other) (self.class == other.class) && (@opcode == other.opcode) end |
#inspect ⇒ String
Inspects the instruction.
46 47 48 |
# File 'lib/python/pickle/instruction.rb', line 46 def inspect "#<#{self.class}: #{self}>" end |
#to_s ⇒ String
Converts the instruction into a String.
37 38 39 |
# File 'lib/python/pickle/instruction.rb', line 37 def to_s @opcode.to_s end |