Sha256: 3504cd7b4b883b4185b8191d84bef35e9a3ded1d90fb63a2d49a6069fb6cfd24

Contents?: true

Size: 539 Bytes

Versions: 13

Compression:

Stored size: 539 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

13 entries across 13 versions & 1 rubygems

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