Class: Riddler::UseCases::PreviewContext

Inherits:
Object
  • Object
show all
Defined in:
lib/riddler/use_cases/preview_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params: {}, headers: {}) ⇒ PreviewContext

Returns a new instance of PreviewContext.



6
7
8
9
# File 'lib/riddler/use_cases/preview_context.rb', line 6

def initialize params: {}, headers: {}
  @params = params
  @headers = headers
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



4
5
6
# File 'lib/riddler/use_cases/preview_context.rb', line 4

def headers
  @headers
end

#paramsObject (readonly)

Returns the value of attribute params.



4
5
6
# File 'lib/riddler/use_cases/preview_context.rb', line 4

def params
  @params
end

Instance Method Details

#contextObject



11
12
13
# File 'lib/riddler/use_cases/preview_context.rb', line 11

def context
  @context ||= generate_context
end

#processObject



15
16
17
# File 'lib/riddler/use_cases/preview_context.rb', line 15

def process
  context.to_hash
end