Module: Ree::FnDSL::ClassMethods

Defined in:
lib/ree/fn_dsl.rb

Instance Method Summary collapse

Instance Method Details

#fn(name, &proc) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ree/fn_dsl.rb', line 14

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