Module: Python::Pickle::Instructions::HasNamespaceAndName
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The constant name.
-
#namespace ⇒ String
readonly
The constant's namespace.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compares the instruction to another instruction.
-
#initialize(opcode, namespace, name) ⇒ Object
Initializes the instruction.
-
#to_s ⇒ String
Converts the instructions to a String.
Instance Attribute Details
#name ⇒ String (readonly)
The constant name.
13 14 15 |
# File 'lib/python/pickle/instructions/has_namespace_and_name.rb', line 13 def name @name end |
#namespace ⇒ String (readonly)
The constant's namespace.
8 9 10 |
# File 'lib/python/pickle/instructions/has_namespace_and_name.rb', line 8 def namespace @namespace end |
Instance Method Details
#==(other) ⇒ Boolean
Compares the instruction to another instruction.
43 44 45 46 47 |
# File 'lib/python/pickle/instructions/has_namespace_and_name.rb', line 43 def ==(other) super(other) && \ (@namespace == other.namespace) && \ (@name == other.name) end |
#initialize(opcode, namespace, name) ⇒ Object
Initializes the instruction.
27 28 29 30 31 32 |
# File 'lib/python/pickle/instructions/has_namespace_and_name.rb', line 27 def initialize(opcode,namespace,name) super(opcode) @namespace = namespace @name = name end |
#to_s ⇒ String
Converts the instructions to a String.
54 55 56 |
# File 'lib/python/pickle/instructions/has_namespace_and_name.rb', line 54 def to_s "#{super} #{@namespace}.#{@name}" end |