Sha256: 48b9ceea436fce2b7a68392acea31fc202c89815b7726f75f0779e96f6b2440e

Contents?: true

Size: 469 Bytes

Versions: 23

Compression:

Stored size: 469 Bytes

Contents

# frozen_string_literal: true

module Ree::FnDSL
  def self.included(base)
    base.extend(ClassMethods)
  end

  def self.extended(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def fn(name, &proc)
      dsl = Ree::ObjectDsl.new(
        Ree.container.packages_facade, name, self, :fn
      )

      dsl.instance_exec(&proc) if block_given?
      dsl.object.set_as_compiled(false)

      Ree.container.compile(dsl.package, name)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ree-1.0.22 lib/ree/fn_dsl.rb
ree-1.0.21 lib/ree/fn_dsl.rb
ree-1.0.20 lib/ree/fn_dsl.rb
ree-1.0.19 lib/ree/fn_dsl.rb
ree-1.0.18 lib/ree/fn_dsl.rb
ree-1.0.17 lib/ree/fn_dsl.rb
ree-1.0.16 lib/ree/fn_dsl.rb
ree-1.0.15 lib/ree/fn_dsl.rb
ree-1.0.14 lib/ree/fn_dsl.rb
ree-1.0.13 lib/ree/fn_dsl.rb
ree-1.0.12 lib/ree/fn_dsl.rb
ree-1.0.11 lib/ree/fn_dsl.rb
ree-1.0.10 lib/ree/fn_dsl.rb
ree-1.0.9 lib/ree/fn_dsl.rb
ree-1.0.8 lib/ree/fn_dsl.rb
ree-1.0.7 lib/ree/fn_dsl.rb
ree-1.0.6 lib/ree/fn_dsl.rb
ree-1.0.5 lib/ree/fn_dsl.rb
ree-1.0.4 lib/ree/fn_dsl.rb
ree-1.0.3 lib/ree/fn_dsl.rb