Sha256: d770485a7c5db6e3ca0a68351c57b8ee688be7fe37782897e08d346e40955e19

Contents?: true

Size: 527 Bytes

Versions: 15

Compression:

Stored size: 527 Bytes

Contents

# frozen_string_literal: true

module Ree::FnDSL
  def self.included(base)
    base.extend(ClassMethods)
    base.include(Ree::Inspectable)
  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.tags(["fn"])
      dsl.object.set_as_compiled(false)

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ree-1.1.1 lib/ree/fn_dsl.rb
ree-1.1.0 lib/ree/fn_dsl.rb
ree-1.0.47 lib/ree/fn_dsl.rb
ree-1.0.46 lib/ree/fn_dsl.rb
ree-1.0.45 lib/ree/fn_dsl.rb
ree-1.0.44 lib/ree/fn_dsl.rb
ree-1.0.43 lib/ree/fn_dsl.rb
ree-1.0.42 lib/ree/fn_dsl.rb
ree-1.0.41 lib/ree/fn_dsl.rb
ree-1.0.40 lib/ree/fn_dsl.rb
ree-1.0.39 lib/ree/fn_dsl.rb
ree-1.0.38 lib/ree/fn_dsl.rb
ree-1.0.37 lib/ree/fn_dsl.rb
ree-1.0.36 lib/ree/fn_dsl.rb
ree-1.0.35 lib/ree/fn_dsl.rb