Class: Sevgi::Sundries::Grid::Axis::Query
- Inherits:
-
Object
- Object
- Sevgi::Sundries::Grid::Axis::Query
- Defined in:
- lib/sevgi/sundries/grid.rb
Overview
Memoized grid line query for an axis.
Instance Method Summary collapse
-
#initialize(this, other) ⇒ void
constructor
private
Creates a query.
-
#lines ⇒ Array<Sevgi::Geometry::Line>
Returns generated grid lines.
-
#points ⇒ Array<Array<Sevgi::Geometry::Point>>
Returns grid line endpoints as points.
-
#xys ⇒ Array<Array<Array<Float>>>
Returns grid line endpoints as coordinate pairs.
Constructor Details
#initialize(this, other) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a query.
142 |
# File 'lib/sevgi/sundries/grid.rb', line 142 def initialize(this, other) = (@this, @other = this, other) |
Instance Method Details
#lines ⇒ Array<Sevgi::Geometry::Line>
Returns generated grid lines. The memoized collection is frozen and must be treated as immutable.
157 |
# File 'lib/sevgi/sundries/grid.rb', line 157 def lines = @lines ||= build.freeze |
#points ⇒ Array<Array<Sevgi::Geometry::Point>>
Returns grid line endpoints as points. The outer and nested collections are frozen and must be treated as immutable.
152 |
# File 'lib/sevgi/sundries/grid.rb', line 152 def points = @points ||= lines.map { it.points(true).freeze }.freeze |
#xys ⇒ Array<Array<Array<Float>>>
Returns grid line endpoints as coordinate pairs. The outer and nested collections are frozen and must be treated as immutable.
147 |
# File 'lib/sevgi/sundries/grid.rb', line 147 def xys = @xys ||= lines.map { it.points(true).map { |point| point.deconstruct.freeze }.freeze }.freeze |