Class: Spinup::PlaygroundBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/spinup/playground_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir, opener) ⇒ PlaygroundBuilder

Returns a new instance of PlaygroundBuilder.



8
9
10
11
# File 'lib/spinup/playground_builder.rb', line 8

def initialize(dir, opener)
  @dir = dir
  @opener = opener
end

Instance Method Details

#call(playground_type, config) ⇒ Object



13
14
15
16
17
18
# File 'lib/spinup/playground_builder.rb', line 13

def call(playground_type, config)
  abort "#{playground_type} is not supported." if config.nil?

  playground = Playground.new(playground_type.to_sym, config)
  playground.establish(@dir) { @opener.(@dir) }
end