Class: Arel::Nodes::LimitBy
- Inherits:
-
Unary
- Object
- Unary
- Arel::Nodes::LimitBy
- Defined in:
- lib/arel/nodes/limit_by.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
Instance Method Summary collapse
-
#initialize(limit, column) ⇒ LimitBy
constructor
A new instance of LimitBy.
Constructor Details
#initialize(limit, column) ⇒ LimitBy
Returns a new instance of LimitBy.
6 7 8 9 10 11 12 13 14 |
# File 'lib/arel/nodes/limit_by.rb', line 6 def initialize(limit, column) raise ArgumentError, 'Limit should be an integer' unless limit.is_a?(Integer) raise ArgumentError, 'Limit should be a positive integer' unless limit >= 0 raise ArgumentError, 'Column should be a Symbol or String' unless column.is_a?(String) || column.is_a?(Symbol) @column = column super(limit) end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
4 5 6 |
# File 'lib/arel/nodes/limit_by.rb', line 4 def column @column end |