Class: Grumlin::Middlewares::FindBlocklistedSteps

Inherits:
Middleware
  • Object
show all
Defined in:
lib/grumlin/middlewares/find_blocklisted_steps.rb

Direct Known Subclasses

FindMutatingSteps

Instance Method Summary collapse

Constructor Details

#initialize(app, *steps) ⇒ FindBlocklistedSteps

Returns a new instance of FindBlocklistedSteps.



4
5
6
7
# File 'lib/grumlin/middlewares/find_blocklisted_steps.rb', line 4

def initialize(app, *steps)
  super(app)
  @validator = Grumlin::QueryValidators::BlocklistedStepsValidator.new(*steps)
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
# File 'lib/grumlin/middlewares/find_blocklisted_steps.rb', line 9

def call(env)
  @validator.validate!(env[:steps_without_shortcuts])
  @app.call(env)
  env[:parsed_results] = @app.call(env).flat_map { |item| Grumlin::Typing.cast(item) }
end