Class: Librarian::Mock::Source::Mock::Registry::Dsl::Top

Inherits:
Object
  • Object
show all
Defined in:
lib/librarian/mock/source/mock/registry.rb

Instance Method Summary collapse

Constructor Details

#initialize(sources) ⇒ Top


10
11
12
# File 'lib/librarian/mock/source/mock/registry.rb', line 10

def initialize(sources)
  @sources = sources
end

Instance Method Details

#source(name, &block) ⇒ Object


13
14
15
16
# File 'lib/librarian/mock/source/mock/registry.rb', line 13

def source(name, &block)
  @sources[name] ||= {}
  Source.new(@sources[name]).instance_eval(&block) if block
end