Class: Tuile::Component::Layout::Fixed
- Inherits:
-
Object
- Object
- Tuile::Component::Layout::Fixed
- Defined in:
- lib/tuile/component/layout.rb,
sig/tuile.rbs
Overview
Instance Attribute Summary collapse
-
#cells ⇒ Integer
readonly
@return — cell count along the axis.
Instance Method Summary collapse
-
#initialize(cells:) ⇒ Fixed
constructor
@param
cells— cell count along the axis;>= 0.
Constructor Details
#initialize(cells:) ⇒ Fixed
@param cells — cell count along the axis; >= 0.
33 34 35 36 37 38 39 |
# File 'lib/tuile/component/layout.rb', line 33 def initialize(cells:) unless cells.is_a?(Integer) && !cells.negative? raise ArgumentError, "Fixed expects a non-negative Integer, got #{cells.inspect}" end super end |
Instance Attribute Details
#cells ⇒ Integer (readonly)
@return — cell count along the axis.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/tuile/component/layout.rb', line 30 class Fixed < Data.define(:cells) # @param cells [Integer] cell count along the axis; `>= 0`. # @raise [ArgumentError] unless `cells` is a non-negative Integer. def initialize(cells:) unless cells.is_a?(Integer) && !cells.negative? raise ArgumentError, "Fixed expects a non-negative Integer, got #{cells.inspect}" end super end end |