Class: Librarian::Mock::Source::Mock::Registry::Dsl::Spec

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

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Spec


35
36
37
# File 'lib/librarian/mock/source/mock/registry.rb', line 35

def initialize(spec)
  @spec = spec
end

Instance Method Details

#version(name, &block) ⇒ Object


38
39
40
41
# File 'lib/librarian/mock/source/mock/registry.rb', line 38

def version(name, &block)
  @spec << { :version => name, :dependencies => {} }
  Version.new(@spec.last[:dependencies]).instance_eval(&block) if block
end