Module: Dugway::Filters::ComparisonFilters
- Defined in:
- lib/dugway/liquid/filters/comparison_filters.rb
Instance Method Summary collapse
- #num_eq(input, operand) ⇒ Object
- #num_gt(input, operand) ⇒ Object
- #num_gte(input, operand) ⇒ Object
- #num_lt(input, operand) ⇒ Object
- #num_lte(input, operand) ⇒ Object
Instance Method Details
#num_eq(input, operand) ⇒ Object
12 13 14 |
# File 'lib/dugway/liquid/filters/comparison_filters.rb', line 12 def num_eq(input, operand) to_number(input) == to_number(operand) end |
#num_gt(input, operand) ⇒ Object
4 5 6 |
# File 'lib/dugway/liquid/filters/comparison_filters.rb', line 4 def num_gt(input, operand) to_number(input) > to_number(operand) end |
#num_gte(input, operand) ⇒ Object
20 21 22 |
# File 'lib/dugway/liquid/filters/comparison_filters.rb', line 20 def num_gte(input, operand) num_eq(input, operand) || num_gt(input, operand) end |
#num_lt(input, operand) ⇒ Object
8 9 10 |
# File 'lib/dugway/liquid/filters/comparison_filters.rb', line 8 def num_lt(input, operand) to_number(input) < to_number(operand) end |
#num_lte(input, operand) ⇒ Object
16 17 18 |
# File 'lib/dugway/liquid/filters/comparison_filters.rb', line 16 def num_lte(input, operand) num_eq(input, operand) || num_lt(input, operand) end |