Module: Formular::Element::Modules::Label::InstanceMethods

Defined in:
lib/formular/element/modules/label.rb

Overview

options functionality: options == String return the string currently we don’t infer label text so if you don’t include label as an option, you wont get one rendered

Instance Method Summary collapse

Instance Method Details

#has_label?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/formular/element/modules/label.rb', line 22

def has_label?
  !label_text.nil? && label_text != false
end

#label_optionsObject



26
27
28
# File 'lib/formular/element/modules/label.rb', line 26

def label_options
  @label_options ||= options[:label_options] || {}
end

#label_textObject



17
18
19
20
# File 'lib/formular/element/modules/label.rb', line 17

def label_text
  return if options[:label].nil? || options[:label] == false
  html_escape(options[:label])
end