Module: CheckboxRenderer

Included in:
CheckboxDefault, CheckboxResponseDefault
Defined in:
lib/inquirer/prompts/checkbox.rb

Overview

Base rendering for simple lists

Instance Method Summary collapse

Instance Method Details

#render(heading = nil, list = [], footer = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/inquirer/prompts/checkbox.rb', line 6

def render heading = nil, list = [], footer = nil
  # render the heading
  ( heading.nil? ? "" : @heading % heading ) +
  # render the list
  list.map do |li|
    render_item li
  end.join("") +
  # render the footer
  ( footer.nil? ? "" : @footer % footer )
end

#renderResponse(heading = nil, response = nil) ⇒ Object



17
18
19
20
21
22
# File 'lib/inquirer/prompts/checkbox.rb', line 17

def renderResponse heading = nil, response = nil
  # render the heading
  ( heading.nil? ? "" : @heading % heading ) +
  # render the footer
  ( response.nil? ? "" : @response % response )
end