Class: Riddler::ContextDirector
- Inherits:
-
Object
- Object
- Riddler::ContextDirector
- Defined in:
- lib/riddler/context_director.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#context ⇒ Object
Create a new context and use registered builders to fill it in.
-
#initialize(options = {}) ⇒ ContextDirector
constructor
A new instance of ContextDirector.
-
#simple_context ⇒ Object
Return the context with only IDs extracted.
Constructor Details
#initialize(options = {}) ⇒ ContextDirector
Returns a new instance of ContextDirector.
6 7 8 9 10 11 12 13 |
# File 'lib/riddler/context_director.rb', line 6 def initialize ={} = {} if .nil? @params = [:params] || ["params"] @headers = [:headers] || ["headers"] @ctx = ::Riddler::Context.new params: params, headers: headers @ids_extracted = false @builders_applied = false end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
4 5 6 |
# File 'lib/riddler/context_director.rb', line 4 def headers @headers end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/riddler/context_director.rb', line 4 def params @params end |
Instance Method Details
#context ⇒ Object
Create a new context and use registered builders to fill it in
22 23 24 25 26 |
# File 'lib/riddler/context_director.rb', line 22 def context extract_ids apply_builders @ctx end |
#simple_context ⇒ Object
Return the context with only IDs extracted
16 17 18 19 |
# File 'lib/riddler/context_director.rb', line 16 def simple_context extract_ids @ctx end |