Class: Viaduct::Runner
- Inherits:
-
Object
- Object
- Viaduct::Runner
- Defined in:
- lib/viaduct/runner.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.run(app, options = nil) ⇒ Object
3 4 5 |
# File 'lib/viaduct/runner.rb', line 3 def self.run(app, =nil) new.run(app, ) end |
Instance Method Details
#run(callable_id, options = nil) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/viaduct/runner.rb', line 7 def run(callable_id, =nil) callable = callable_id callable = Builder.new.use(callable_id) if callable_id.kind_of?(Class) raise ArgumentError, "Argument to run must be a callable object or known class." if !callable || !callable.respond_to?(:call) # Create the initial environment with the options given environment = Environment.new environment.merge!( || {}) callable.call(environment) environment end |