Class: Navigasmic::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/navigasmic/core/configuration.rb

Constant Summary collapse

@@default_builder =
Navigasmic::Builder::ListBuilder
@@builder_configurations =
{}
@@definitions =
{}

Class Method Summary collapse

Class Method Details

.builder(builder, &block) ⇒ Object


20
21
22
23
24
25
26
27
28
29
# File 'lib/navigasmic/core/configuration.rb', line 20

def self.builder(builder, &block)
  if builder.is_a?(Hash)
    name = builder.keys[0]
    builder = builder[name]
  else
    name = :default
  end
  @@builder_configurations[builder.to_s] ||= {}
  @@builder_configurations[builder.to_s][name] = block
end

.semantic_navigation(name, &block) ⇒ Object


16
17
18
# File 'lib/navigasmic/core/configuration.rb', line 16

def self.semantic_navigation(name, &block)
  @@definitions[name] = block
end