class Gluer::DSL

Public Class Methods

add_registration_definition(name, definition) click to toggle source
# File lib/gluer/dsl.rb, line 17
def add_registration_definition(name, definition)
  defined_registrations[name] = definition

  define_method(name) do |*args, &block|
    definition   = DSL.get_registration_definition(name)
    registration = Registration.new(definition, @context, args, block)
    @registration_collection.add(registration)
  end
end
clear() click to toggle source
# File lib/gluer/dsl.rb, line 31
def clear
  @defined_registrations = nil
end
get_registration_definition(name) click to toggle source
# File lib/gluer/dsl.rb, line 27
def get_registration_definition(name)
  defined_registrations.fetch(name)
end
new(context, registration_collection) click to toggle source
# File lib/gluer/dsl.rb, line 42
def initialize(context, registration_collection)
  @context = context
  @registration_collection = registration_collection
end

Private Class Methods

defined_registrations() click to toggle source
# File lib/gluer/dsl.rb, line 37
def defined_registrations
  @defined_registrations ||= {}
end