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

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

Methods

[]   new  

Public Class methods

[Source]

     # File sources/parser/array.rb, line 149
149:       def [](coords)
150:         corners = coords.values_at(:llx, :lly, :urx, :ury)
151:         
152:         unless corners.all? { |corner| corner.is_a?(Numeric) }
153:           raise TypeError, "All coords must be numbers"
154:         end
155:         
156:         Rectangle.new(*corners)
157:       end

[Source]

     # File sources/parser/array.rb, line 161
161:     def initialize(lowerleftx, lowerlefty, upperrightx, upperrighty)
162:       super([ lowerleftx, lowerlefty, upperrightx, upperrighty ])
163:     end

[Validate]