class Handlebars::Helpers::Comparison::Lte

Lte: (less than or equal to) Block helper that renders a block if `a` is **less than or equal to** `b`. If an inverse block is specified it will be rendered when falsy.

Public Instance Methods

handlebars_helper() click to toggle source
# File lib/handlebars/helpers/comparison/lte.rb, line 37
def handlebars_helper
  proc { |_context, lhs, rhs| wrapper(parse(lhs, rhs)) }
end
parse(lhs, rhs) click to toggle source

Parse will Lte: (less than or equal to) Block helper that renders a block if `a` is **less than or equal to** `b`. If an inverse block is specified it will be rendered when falsy.

@example

puts Lte.new.parse(1, 2)

Truthy

puts Lte.new.parse(1, 1)

Truthy

puts Lte.new.parse(2, 1)

Falsey

@param [String] lhs - left hand side value @param [String] rhs - right hand side value @return [String] truthy value if left hand side LESS THAN or EQUAL to right hand side

# File lib/handlebars/helpers/comparison/lte.rb, line 33
def parse(lhs, rhs)
  lhs <= rhs
end