Class: SoarFlow::ID

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#appObject (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_idObject



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