Class: Graftcode::Context::RequestContext
- Inherits:
-
Object
- Object
- Graftcode::Context::RequestContext
- Defined in:
- lib/graftcode/context/request_context.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Class Method Summary collapse
Instance Method Summary collapse
- #get_headers ⇒ Object
-
#initialize ⇒ RequestContext
constructor
A new instance of RequestContext.
- #set_headers(headers) ⇒ Object
Constructor Details
#initialize ⇒ RequestContext
Returns a new instance of RequestContext.
14 15 16 |
# File 'lib/graftcode/context/request_context.rb', line 14 def initialize @headers = {} end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
12 13 14 |
# File 'lib/graftcode/context/request_context.rb', line 12 def headers @headers end |
Class Method Details
.current ⇒ Object
7 8 9 |
# File 'lib/graftcode/context/request_context.rb', line 7 def current @current ||= RequestContext.new end |
Instance Method Details
#get_headers ⇒ Object
18 19 20 |
# File 'lib/graftcode/context/request_context.rb', line 18 def get_headers @headers end |
#set_headers(headers) ⇒ Object
22 23 24 |
# File 'lib/graftcode/context/request_context.rb', line 22 def set_headers(headers) @headers = headers.to_h end |