Class Origami::Rectangle
In: sources/parser/misc.rb
Parent: Array

Class representing a location on a page or a bounding box.

Methods

[]   new  

Public Class methods

[Source]

     # File sources/parser/misc.rb, line 138
138:       def [](coords)
139:         corners = coords.values_at(:llx, :lly, :urx, :ury)
140:         
141:         unless corners.all? { |corner| corner.is_a?(Numeric) }
142:           raise TypeError, "All coords must be numbers"
143:         end
144:         
145:         Rectangle.new(*corners)
146:       end

[Source]

     # File sources/parser/misc.rb, line 150
150:     def initialize(lowerleftx, lowerlefty, upperrightx, upperrighty, indirect = false)
151:       
152:       super([ lowerleftx, lowerlefty, upperrightx, upperrighty ], indirect)
153:       
154:     end

[Validate]