Class: Macmillan::Utils::Middleware::Uuid::CallHandler
- Inherits:
-
Object
- Object
- Macmillan::Utils::Middleware::Uuid::CallHandler
- Defined in:
- lib/macmillan/utils/middleware/uuid.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#cookie_key ⇒ Object
readonly
Returns the value of attribute cookie_key.
-
#rack_errors ⇒ Object
readonly
Returns the value of attribute rack_errors.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#user_env_key ⇒ Object
readonly
Returns the value of attribute user_env_key.
-
#user_id_method ⇒ Object
readonly
Returns the value of attribute user_id_method.
-
#uuid_is_new_key ⇒ Object
readonly
Returns the value of attribute uuid_is_new_key.
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(env, app, user_env_key, user_id_method, cookie_key) ⇒ CallHandler
constructor
A new instance of CallHandler.
Constructor Details
#initialize(env, app, user_env_key, user_id_method, cookie_key) ⇒ CallHandler
Returns a new instance of CallHandler.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 27 def initialize(env, app, user_env_key, user_id_method, ) @app = app @request = Rack::Request.new(env) @user_env_key = user_env_key @user_id_method = user_id_method @cookie_key = @rack_errors = env['rack.errors'] @uuid_is_new_key = "#{}_is_new" env[] = final_user_uuid env[uuid_is_new_key] = true if uuid_is_new? end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
25 26 27 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 25 def app @app end |
#cookie_key ⇒ Object (readonly)
Returns the value of attribute cookie_key.
25 26 27 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 25 def @cookie_key end |
#rack_errors ⇒ Object (readonly)
Returns the value of attribute rack_errors.
25 26 27 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 25 def rack_errors @rack_errors end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
25 26 27 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 25 def request @request end |
#user_env_key ⇒ Object (readonly)
Returns the value of attribute user_env_key.
25 26 27 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 25 def user_env_key @user_env_key end |
#user_id_method ⇒ Object (readonly)
Returns the value of attribute user_id_method.
25 26 27 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 25 def user_id_method @user_id_method end |
#uuid_is_new_key ⇒ Object (readonly)
Returns the value of attribute uuid_is_new_key.
25 26 27 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 25 def uuid_is_new_key @uuid_is_new_key end |
Instance Method Details
#finish ⇒ Object
40 41 42 43 44 |
# File 'lib/macmillan/utils/middleware/uuid.rb', line 40 def finish if response.finish end |