Sha256: 0c827386850b4d35ec035545a4de6dea9d5f74fa6f804860a279b07522e33e41

Contents?: true

Size: 296 Bytes

Versions: 1

Compression:

Stored size: 296 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'treetop'
require_relative 'base_scope_fn'

# Renders unless a condition is met
class Unless < BaseScopeFn
  def to_html(body, context)
    if boolean_expr.truthy?(context)
      ''
    else
      body.to_html(context)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
emerald-lang-1.0.0 lib/emerald/nodes/unless.rb