Sha256: d1de5b536fee6358c4c02378039cb514025ad12925a04687e00112d00f886dee

Contents?: true

Size: 291 Bytes

Versions: 1

Compression:

Stored size: 291 Bytes

Contents

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

require 'treetop'
require_relative 'base_scope_fn'

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

Version data entries

1 entries across 1 versions & 1 rubygems

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