Module: Origami::Number
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
43
44
45
|
# File 'lib/origami/numeric.rb', line 43
def &(val)
self.class.new(self.to_i & val)
end
|
71
72
73
|
# File 'lib/origami/numeric.rb', line 71
def *(val)
self.class.new(self.to_i * val)
end
|
83
84
85
|
# File 'lib/origami/numeric.rb', line 83
def **(val)
self.class.new(self.to_i ** val)
end
|
59
60
61
|
# File 'lib/origami/numeric.rb', line 59
def +(val)
self.class.new(self.to_i + val)
end
|
63
64
65
|
# File 'lib/origami/numeric.rb', line 63
def -(val)
self.class.new(self.to_i - val)
end
|
67
68
69
|
# File 'lib/origami/numeric.rb', line 67
def -@
self.class.new(-self.to_i)
end
|
75
76
77
|
# File 'lib/origami/numeric.rb', line 75
def /(val)
self.class.new(self.to_i / val)
end
|
51
52
53
|
# File 'lib/origami/numeric.rb', line 51
def <<(val)
self.class.new(self.to_i << val)
end
|
55
56
57
|
# File 'lib/origami/numeric.rb', line 55
def >>(val)
self.class.new(self.to_i >> val)
end
|
47
48
49
|
# File 'lib/origami/numeric.rb', line 47
def ^(val)
self.class.new(self.to_i ^ val)
end
|
79
80
81
|
# File 'lib/origami/numeric.rb', line 79
def abs
self.class.new(self.to_i.abs)
end
|
#real_type ⇒ Object
91
|
# File 'lib/origami/numeric.rb', line 91
def real_type ; Number end
|
87
88
89
|
# File 'lib/origami/numeric.rb', line 87
def to_s
super(value.to_s)
end
|
39
40
41
|
# File 'lib/origami/numeric.rb', line 39
def |(val)
self.class.new(self.to_i | val)
end
|
35
36
37
|
# File 'lib/origami/numeric.rb', line 35
def ~
self.class.new(~self.to_i)
end
|