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

#<=>, #copy, #indirect_parent, #initialize, #is_indirect?, parse, #pdf, #pdf_version_required, #post_build, #pre_build, #reference, #set_indirect, #set_pdf, #size, skip_until_next_obj, #solve, #to_o, #type, typeof, #xrefs

Instance Method Details

#&(val) ⇒ Object



43
44
45
# File 'lib/origami/numeric.rb', line 43

def &(val)
  self.class.new(self.to_i & val)
end

#*(val) ⇒ Object



71
72
73
# File 'lib/origami/numeric.rb', line 71

def *(val)
  self.class.new(self.to_i * val)
end

#**(val) ⇒ Object



83
84
85
# File 'lib/origami/numeric.rb', line 83

def **(val)
  self.class.new(self.to_i ** val)
end

#+(val) ⇒ Object



59
60
61
# File 'lib/origami/numeric.rb', line 59

def +(val)
  self.class.new(self.to_i + val)
end

#-(val) ⇒ Object



63
64
65
# File 'lib/origami/numeric.rb', line 63

def -(val)
  self.class.new(self.to_i - val)
end

#-@Object



67
68
69
# File 'lib/origami/numeric.rb', line 67

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

#/(val) ⇒ Object



75
76
77
# File 'lib/origami/numeric.rb', line 75

def /(val)
  self.class.new(self.to_i / val)
end

#<<(val) ⇒ Object



51
52
53
# File 'lib/origami/numeric.rb', line 51

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

#>>(val) ⇒ Object



55
56
57
# File 'lib/origami/numeric.rb', line 55

def >>(val)
  self.class.new(self.to_i >> val)
end

#^(val) ⇒ Object



47
48
49
# File 'lib/origami/numeric.rb', line 47

def ^(val)
  self.class.new(self.to_i ^ val)
end

#absObject



79
80
81
# File 'lib/origami/numeric.rb', line 79

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

#real_typeObject



91
# File 'lib/origami/numeric.rb', line 91

def real_type ; Number end

#to_sObject



87
88
89
# File 'lib/origami/numeric.rb', line 87

def to_s
  super(value.to_s)
end

#|(val) ⇒ Object



39
40
41
# File 'lib/origami/numeric.rb', line 39

def |(val)
  self.class.new(self.to_i | val)
end

#~Object



35
36
37
# File 'lib/origami/numeric.rb', line 35

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