Class: Python::Pickle::Instructions::Global
- Inherits:
-
Python::Pickle::Instruction
- Object
- Python::Pickle::Instruction
- Python::Pickle::Instructions::Global
- Defined in:
- lib/python/pickle/instructions/global.rb
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The global object name.
-
#namespace ⇒ String
readonly
The global object namespace.
Attributes inherited from Python::Pickle::Instruction
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compares the
GLOBALinstruction to another instruction. -
#initialize(namespace, name) ⇒ Global
constructor
Initializes the
GLOBALinstruction. -
#to_s ⇒ String
Converts the
GLOBALinstructions to a String.
Methods inherited from Python::Pickle::Instruction
Constructor Details
#initialize(namespace, name) ⇒ Global
Initializes the GLOBAL instruction.
28 29 30 31 32 33 |
# File 'lib/python/pickle/instructions/global.rb', line 28 def initialize(namespace,name) super(:GLOBAL) @namespace = namespace @name = name end |
Instance Attribute Details
#name ⇒ String (readonly)
The global object name.
17 18 19 |
# File 'lib/python/pickle/instructions/global.rb', line 17 def name @name end |
#namespace ⇒ String (readonly)
The global object namespace.
12 13 14 |
# File 'lib/python/pickle/instructions/global.rb', line 12 def namespace @namespace end |
Instance Method Details
#==(other) ⇒ Boolean
Compares the GLOBAL instruction to another instruction.
44 45 46 47 48 |
# File 'lib/python/pickle/instructions/global.rb', line 44 def ==(other) super(other) && \ (@namespace == other.namespace) && \ (@name == other.name) end |
#to_s ⇒ String
Converts the GLOBAL instructions to a String.
55 56 57 |
# File 'lib/python/pickle/instructions/global.rb', line 55 def to_s "#{super} #{@namespace}.#{@name}" end |