class Riddler::ContextBuilder

Attributes

context[R]

Public Class Methods

new(context) click to toggle source
# File lib/riddler/context_builder.rb, line 5
def initialize context
  @context = context
end

Public Instance Methods

data_available?() click to toggle source

Does the current context have the data available for this builder to function

# File lib/riddler/context_builder.rb, line 11
def data_available?
  true
end
extract_ids() click to toggle source

Extract IDs from the context (params, headers, JWTs, etc) and store them in context.ids

# File lib/riddler/context_builder.rb, line 17
def extract_ids
  # no-op
end
process() click to toggle source

Inspect context for identifiers or data. Add any additional relevant information to the context

# File lib/riddler/context_builder.rb, line 23
def process
  # no-op
end

Private Instance Methods

add_id(name, value) click to toggle source

Adds the ID to the context and defines a method for the ID

# File lib/riddler/context_builder.rb, line 30
def add_id name, value
  context.add_id name, value
  define_singleton_method(name) { value }
end