Class: Canopus::BlockSelection
- Inherits:
-
Data
- Object
- Data
- Canopus::BlockSelection
- Includes:
- Enumerable, Enumerable[[DisplayPoint,
- Defined in:
- lib/canopus/selection.rb,
sig/canopus.rbs
Instance Attribute Summary collapse
-
#anchor ⇒ Object
readonly
Returns the value of attribute anchor.
-
#head ⇒ Object
readonly
Returns the value of attribute head.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#anchor ⇒ Object (readonly)
Returns the value of attribute anchor
12 13 14 |
# File 'lib/canopus/selection.rb', line 12 def anchor @anchor end |
#head ⇒ Object (readonly)
Returns the value of attribute head
12 13 14 |
# File 'lib/canopus/selection.rb', line 12 def head @head end |
Class Method Details
.new ⇒ instance
35 |
# File 'sig/canopus.rbs', line 35
def self.new: (DisplayPoint anchor, DisplayPoint head) -> instance
|
Instance Method Details
#each ⇒ self #each ⇒ Enumerator[[DisplayPoint, DisplayPoint], self]
15 16 17 18 19 20 21 |
# File 'lib/canopus/selection.rb', line 15 def each return enum_for(__method__) unless block_given? first, last = [anchor.row, head.row].minmax first.upto(last) do |row| yield DisplayPoint.new(row, anchor.column), DisplayPoint.new(row, head.column) end end |