Class: GovukPublishingComponents::Presenters::StepByStepModel

Inherits:
Object
  • Object
show all
Defined in:
lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb

Instance Method Summary collapse

Constructor Details

#initialize(content_item) ⇒ StepByStepModel

Returns a new instance of StepByStepModel.



199
200
201
# File 'lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb', line 199

def initialize(content_item)
  @content_item = content_item.deep_symbolize_keys
end

Instance Method Details

#base_pathObject



207
208
209
# File 'lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb', line 207

def base_path
  content_item[:base_path]
end

#contentObject



215
216
217
# File 'lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb', line 215

def content
  content_item.dig(:details, :step_by_step_nav)
end

#content_idObject



211
212
213
# File 'lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb', line 211

def content_id
  content_item[:content_id]
end

#stepsObject



219
220
221
# File 'lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb', line 219

def steps
  content_item.dig(:details, :step_by_step_nav, :steps)
end

#titleObject



203
204
205
# File 'lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb', line 203

def title
  content_item[:title]
end