Module: Origami::Number

Includes:
Object
Included in:
Integer, Real
Defined in:
lib/origami/numeric.rb

Overview

Class representing a PDF number (Integer, or Real).

Constant Summary

Constants included from Object

Object::TOKENS

Instance Attribute Summary

Attributes included from Object

#file_offset, #generation, #no, #objstm_offset, #parent

Instance Method Summary collapse

Methods included from Object

#cast_to, #copy, #document, #export, included, #indirect?, #indirect_parent, #initialize, #logicalize, #logicalize!, #native_type, #numbered?, parse, #post_build, #pre_build, #reference, #set_document, #set_indirect, skip_until_next_obj, #solve, #to_o, #to_s, #type, typeof, #version_required, #xrefs

Instance Method Details

#&(other) ⇒ Object



41
42
43
# File 'lib/origami/numeric.rb', line 41

def &(other)
  self.class.new(value & other)
end

#*(other) ⇒ Object



69
70
71
# File 'lib/origami/numeric.rb', line 69

def *(other)
  self.class.new(value * other)
end

#**(other) ⇒ Object



81
82
83
# File 'lib/origami/numeric.rb', line 81

def **(other)
  self.class.new(value**other)
end

#+(other) ⇒ Object



57
58
59
# File 'lib/origami/numeric.rb', line 57

def +(other)
  self.class.new(value + other)
end

#-(other) ⇒ Object



61
62
63
# File 'lib/origami/numeric.rb', line 61

def -(other)
  self.class.new(value - other)
end

#-@Object



65
66
67
# File 'lib/origami/numeric.rb', line 65

def -@
  self.class.new(-value)
end

#/(other) ⇒ Object



73
74
75
# File 'lib/origami/numeric.rb', line 73

def /(other)
  self.class.new(value / other)
end

#<<(val) ⇒ Object



49
50
51
# File 'lib/origami/numeric.rb', line 49

def <<(val)
  self.class.new(value << val)
end

#>>(other) ⇒ Object



53
54
55
# File 'lib/origami/numeric.rb', line 53

def >>(other)
  self.class.new(value >> other)
end

#^(other) ⇒ Object



45
46
47
# File 'lib/origami/numeric.rb', line 45

def ^(other)
  self.class.new(value ^ other)
end

#absObject



77
78
79
# File 'lib/origami/numeric.rb', line 77

def abs
  self.class.new(value.abs)
end

#|(other) ⇒ Object



37
38
39
# File 'lib/origami/numeric.rb', line 37

def |(other)
  self.class.new(value | other)
end

#~Object



33
34
35
# File 'lib/origami/numeric.rb', line 33

def ~
  self.class.new(~value)
end