Class: Squid::Gridline
- Inherits:
-
Object
- Object
- Squid::Gridline
- Defined in:
- lib/squid/gridline.rb
Instance Attribute Summary collapse
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(y:) ⇒ Gridline
constructor
A new instance of Gridline.
Constructor Details
#initialize(y:) ⇒ Gridline
Returns a new instance of Gridline.
12 13 14 |
# File 'lib/squid/gridline.rb', line 12 def initialize(y:) @y = y end |
Instance Attribute Details
#y ⇒ Object (readonly)
Returns the value of attribute y.
10 11 12 |
# File 'lib/squid/gridline.rb', line 10 def y @y end |
Class Method Details
.for(count:, skip_baseline:, height:) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/squid/gridline.rb', line 3 def self.for(count:, skip_baseline:, height:) return [] if count.zero? height.step(0, -height/count.to_f).map do |y| new y: y unless skip_baseline && y.zero? end.compact end |