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, parse, #post_build, #pre_build, #reference, #set_document, #set_indirect, skip_until_next_obj, #solve, #to_o, #type, typeof, #version_required, #xrefs

Instance Method Details

#&(val) ⇒ Object



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

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

#*(val) ⇒ Object



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

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

#**(val) ⇒ Object



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

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

#+(val) ⇒ Object



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

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

#-(val) ⇒ Object



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

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

#-@Object



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

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

#/(val) ⇒ Object



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

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

#<<(val) ⇒ Object



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

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

#>>(val) ⇒ Object



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

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

#^(val) ⇒ Object



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

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

#absObject



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

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

#to_sObject



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

def to_s
    super(value.to_s)
end

#|(val) ⇒ Object



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

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

#~Object



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

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