Class: Dandy::ChainFactory
- Inherits:
-
Object
- Object
- Dandy::ChainFactory
- Defined in:
- lib/dandy/chain_factory.rb
Instance Method Summary collapse
- #create(match) ⇒ Object
-
#initialize(container, dandy_config) ⇒ ChainFactory
constructor
A new instance of ChainFactory.
Constructor Details
#initialize(container, dandy_config) ⇒ ChainFactory
Returns a new instance of ChainFactory.
5 6 7 8 |
# File 'lib/dandy/chain_factory.rb', line 5 def initialize(container, dandy_config) @container = container @dandy_config = dandy_config end |
Instance Method Details
#create(match) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/dandy/chain_factory.rb', line 10 def create(match) status = match.route.http_status || default_http_status(match.route.http_verb) register_params(match.params) register_status(status) Chain.new(@container, @dandy_config, match.route.commands, match.route.last_command, match.route.catch) end |