Class: Blender3d::Pointer
- Inherits:
-
Object
- Object
- Blender3d::Pointer
- Defined in:
- lib/blender-3d/pointer.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(location) ⇒ Pointer
constructor
A new instance of Pointer.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(location) ⇒ Pointer
Returns a new instance of Pointer.
5 6 7 |
# File 'lib/blender-3d/pointer.rb', line 5 def initialize(location) @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/blender-3d/pointer.rb', line 3 def location @location end |
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 |
# File 'lib/blender-3d/pointer.rb', line 19 def <=>(other) other.is_a?(Pointer) ? location <=> other.location : 1 end |
#==(other) ⇒ Object
23 24 25 |
# File 'lib/blender-3d/pointer.rb', line 23 def ==(other) (self <=> other) == 0 end |
#inspect ⇒ Object
13 14 15 16 17 |
# File 'lib/blender-3d/pointer.rb', line 13 def inspect return '0x0' if @location == 0 return '0x%08x' % @location if @location < (1 << 32) '0x%016x' % @location end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/blender-3d/pointer.rb', line 9 def to_s "Pointer(#{inspect})" end |