Class: Riddler::UseCases::PreviewStep

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition, params: {}, headers: {}) ⇒ PreviewStep

Returns a new instance of PreviewStep.



6
7
8
9
10
11
# File 'lib/riddler/use_cases/preview_step.rb', line 6

def initialize definition, params: {}, headers: {}
  @definition = definition
  @params = params
  @headers = headers
  @step = ::Riddler::Step.for definition, context
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



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

def definition
  @definition
end

#headersObject (readonly)

Returns the value of attribute headers.



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

def headers
  @headers
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

#stepObject (readonly)

Returns the value of attribute step.



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

def step
  @step
end

Instance Method Details

#contextObject



13
14
15
# File 'lib/riddler/use_cases/preview_step.rb', line 13

def context
  @context ||= generate_context
end

#processObject



17
18
19
# File 'lib/riddler/use_cases/preview_step.rb', line 17

def process
  step.to_hash
end