Class: PDF::TrimDetector::Path
- Inherits:
-
Object
- Object
- PDF::TrimDetector::Path
- Defined in:
- lib/pdf/trim_detector.rb
Instance Method Summary collapse
- #add_point(x, y) ⇒ Object
- #horizontal? ⇒ Boolean
-
#initialize ⇒ Path
constructor
A new instance of Path.
- #start ⇒ Object
- #vertical? ⇒ Boolean
Constructor Details
#initialize ⇒ Path
Returns a new instance of Path.
131 132 133 |
# File 'lib/pdf/trim_detector.rb', line 131 def initialize @points = [] end |
Instance Method Details
#add_point(x, y) ⇒ Object
139 140 141 |
# File 'lib/pdf/trim_detector.rb', line 139 def add_point(x, y) @points << Point.new(x, y) end |
#horizontal? ⇒ Boolean
143 144 145 |
# File 'lib/pdf/trim_detector.rb', line 143 def horizontal? @points.size == 2 && y_points.uniq.size == 1 end |
#start ⇒ Object
135 136 137 |
# File 'lib/pdf/trim_detector.rb', line 135 def start @points.first end |
#vertical? ⇒ Boolean
147 148 149 |
# File 'lib/pdf/trim_detector.rb', line 147 def vertical? @points.size == 2 && x_points.uniq.size == 1 end |