Module: MobileWorkflow::Displayable::Steps::StyledContent::Grid

Included in:
MobileWorkflow::Displayable
Defined in:
app/models/concerns/mobile_workflow/displayable/steps/styled_content/grid.rb

Instance Method Summary collapse

Instance Method Details

#mw_grid_item(id: self.id, text:, detail_text: nil, preview_url: nil) ⇒ Object



20
21
22
23
24
25
# File 'app/models/concerns/mobile_workflow/displayable/steps/styled_content/grid.rb', line 20

def mw_grid_item(id: self.id, text:, detail_text: nil, preview_url: nil)
  raise 'Missing id' if id.nil?
  raise 'Missing text' if text.nil?
  
  { id: id, text: text, type: :item, detailText: detail_text, imageURL: preview_url }.compact
end

#mw_grid_large_section(id:, text:) ⇒ Object



6
7
8
9
10
11
# File 'app/models/concerns/mobile_workflow/displayable/steps/styled_content/grid.rb', line 6

def mw_grid_large_section(id:, text:)
  raise 'Missing id' if id.nil?
  raise 'Missing text' if text.nil?
  
  { id: id, text: text, type: :largeSection }
end

#mw_grid_small_section(id:, text:) ⇒ Object



13
14
15
16
17
18
# File 'app/models/concerns/mobile_workflow/displayable/steps/styled_content/grid.rb', line 13

def mw_grid_small_section(id:, text:)
  raise 'Missing id' if id.nil?
  raise 'Missing text' if text.nil?
  
  { id: id, text: text, type: :smallSection }
end