Method: ExcelTemplating::DocumentDsl#list_source

Defined in:
lib/excel_templating/document_dsl.rb

#list_source(source_symbol, title:, list: :from_data, inline: false) ⇒ Object

Add a list validator to the excel document

Examples:

list_source :valid_foos, title: "Valid Foos", list: ['foo','bar'], inline: false

Parameters:

  • source_symbol (Symbol)

    symbol to registry for the validator

  • title (String)

    Title to show when displaying this validator

  • list (Array<String>|Symbol) (defaults to: :from_data)

    items to use for validation, you may also use :from_data and at render time the validation items will be fetched from key 'source_symbol'

  • inline (TrueClass|FalseClass) (defaults to: false)

    If true then the validator will be written to the document inline. Otherwise it will be written to a 'DataSheet'



51
52
53
# File 'lib/excel_templating/document_dsl.rb', line 51

def list_source(source_symbol, title:, list: :from_data, inline: false)
  data_source_registry.add_list(source_symbol, title, list, inline)
end