Module: ReeRoutes::DSL::ClassMethods

Includes:
Ree::Contracts::ArgContracts, Ree::Contracts::Core
Defined in:
lib/ree_lib/packages/ree_routes/package/ree_routes/dsl.rb

Instance Method Summary collapse

Instance Method Details

#default_warden_scope(method_name) ⇒ Object



47
48
49
# File 'lib/ree_lib/packages/ree_routes/package/ree_routes/dsl.rb', line 47

def default_warden_scope(method_name)
  @default_warden_scope = method_name
end

#routes(name, &proc) ⇒ Object

Raises:

  • (ArgumentError)


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ree_lib/packages/ree_routes/package/ree_routes/dsl.rb', line 27

def routes(name, &proc)
  raise ArgumentError.new("block is required") if !block_given?

  @dsl = Ree::ObjectDsl.new(
    Ree.container.packages_facade, name, self, :object
  )

  @dsl.singleton
  @dsl.factory(:build)
  @dsl.tags(["routes"])

  instance_exec(&proc)

  klass = @dsl.object.klass
  klass.send(:include, FactoryMethod)


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