Class: AllStak::Models::RequestContext
- Inherits:
-
Object
- Object
- AllStak::Models::RequestContext
- Defined in:
- lib/allstak/models/user_context.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#method ⇒ Object
Returns the value of attribute method.
-
#path ⇒ Object
Returns the value of attribute path.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize(method: nil, path: nil, host: nil, status_code: nil, user_agent: nil) ⇒ RequestContext
constructor
A new instance of RequestContext.
- #to_h ⇒ Object
Constructor Details
#initialize(method: nil, path: nil, host: nil, status_code: nil, user_agent: nil) ⇒ RequestContext
Returns a new instance of RequestContext.
24 25 26 27 28 29 30 |
# File 'lib/allstak/models/user_context.rb', line 24 def initialize(method: nil, path: nil, host: nil, status_code: nil, user_agent: nil) @method = method @path = path @host = host @status_code = status_code @user_agent = user_agent end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
22 23 24 |
# File 'lib/allstak/models/user_context.rb', line 22 def host @host end |
#method ⇒ Object
Returns the value of attribute method.
22 23 24 |
# File 'lib/allstak/models/user_context.rb', line 22 def method @method end |
#path ⇒ Object
Returns the value of attribute path.
22 23 24 |
# File 'lib/allstak/models/user_context.rb', line 22 def path @path end |
#status_code ⇒ Object
Returns the value of attribute status_code.
22 23 24 |
# File 'lib/allstak/models/user_context.rb', line 22 def status_code @status_code end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
22 23 24 |
# File 'lib/allstak/models/user_context.rb', line 22 def user_agent @user_agent end |
Instance Method Details
#to_h ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/allstak/models/user_context.rb', line 32 def to_h out = {} out[:method] = @method unless @method.nil? out[:path] = @path unless @path.nil? out[:host] = @host unless @host.nil? out[:statusCode] = @status_code unless @status_code.nil? out[:userAgent] = @user_agent unless @user_agent.nil? out end |