class Blender3d::Pointer

Attributes

location[R]
to_i[R]

Public Class Methods

new(location) click to toggle source
# File lib/blender-3d/pointer.rb, line 5
def initialize(location)
  @location = location
end

Public Instance Methods

!=(other) click to toggle source
# File lib/blender-3d/pointer.rb, line 27
def !=(other)
  !(self == other)
end
+(other) click to toggle source
# File lib/blender-3d/pointer.rb, line 35
def +(other)
  return Pointer.new(@location + other) if other.is_a?(Integer)
  raise TypeError, "#{other.class} cannot be implicitly converted into an Integer"
end
-(other) click to toggle source
# File lib/blender-3d/pointer.rb, line 40
def -(other)
  return Pointer.new(@location - other) if other.is_a?(Integer)
  return @location - other.location if other.is_a?(Pointer)
  raise TypeError, "#{other.class} cannot be implicitly converted into a Pointer"
end
<=>(other) click to toggle source
# File lib/blender-3d/pointer.rb, line 19
def <=>(other)
  other.is_a?(Pointer) || other.is_a?(Integer) ? to_i <=> other.to_i : 1
end
==(other) click to toggle source
# File lib/blender-3d/pointer.rb, line 23
def ==(other)
  (self <=> other) == 0
end
Also aliased as: eql?
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/blender-3d/pointer.rb, line 31
def hash
  @location.hash
end
inspect() click to toggle source
# 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() click to toggle source
# File lib/blender-3d/pointer.rb, line 9
def to_s
  "Pointer(#{inspect})"
end