Class: SoarFlow::ID
- Inherits:
-
Object
- Object
- SoarFlow::ID
- Defined in:
- lib/soar_flow.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ID
constructor
A new instance of ID.
Constructor Details
#initialize(app) ⇒ ID
Returns a new instance of ID.
9 10 11 |
# File 'lib/soar_flow.rb', line 9 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/soar_flow.rb', line 7 def app @app end |
Class Method Details
.generate_flow_id ⇒ Object
20 21 22 |
# File 'lib/soar_flow.rb', line 20 def self.generate_flow_id "#{SecureRandom.hex(32)}" end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/soar_flow.rb', line 13 def call(env) request = Rack::Request.new(env) request = generate_or_honor_flow_id(request) request.update_param('flow_identifier', request.params['flow_identifier']) @app.call(env) end |