Sha256: 45f512bd8848a85b7e345e6de1dc9b2c877b6e5249265986366abb282c2e22e1

Contents?: true

Size: 477 Bytes

Versions: 23

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

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

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

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

      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/bean_dsl.rb
ree-1.0.21 lib/ree/bean_dsl.rb
ree-1.0.20 lib/ree/bean_dsl.rb
ree-1.0.19 lib/ree/bean_dsl.rb
ree-1.0.18 lib/ree/bean_dsl.rb
ree-1.0.17 lib/ree/bean_dsl.rb
ree-1.0.16 lib/ree/bean_dsl.rb
ree-1.0.15 lib/ree/bean_dsl.rb
ree-1.0.14 lib/ree/bean_dsl.rb
ree-1.0.13 lib/ree/bean_dsl.rb
ree-1.0.12 lib/ree/bean_dsl.rb
ree-1.0.11 lib/ree/bean_dsl.rb
ree-1.0.10 lib/ree/bean_dsl.rb
ree-1.0.9 lib/ree/bean_dsl.rb
ree-1.0.8 lib/ree/bean_dsl.rb
ree-1.0.7 lib/ree/bean_dsl.rb
ree-1.0.6 lib/ree/bean_dsl.rb
ree-1.0.5 lib/ree/bean_dsl.rb
ree-1.0.4 lib/ree/bean_dsl.rb
ree-1.0.3 lib/ree/bean_dsl.rb