Class: CaseForm::Element::Label

Inherits:
Base
  • Object
show all
Includes:
CaseForm::ElementExt::Columnable, CaseForm::ElementExt::Validationable
Defined in:
lib/case_form/element/label.rb

Constant Summary

Constants inherited from Base

Base::HTML_OPTIONS

Instance Attribute Summary collapse

Attributes inherited from Base

#builder, #options

Instance Method Summary collapse

Methods included from CaseForm::ElementExt::Columnable

#columnable?, #object_column, #object_column_type?, #specific_method

Methods included from CaseForm::ElementExt::Validationable

#method_validations, #validationable?

Methods included from CaseForm::ElementExt::Naming

#object_human_model_name, #sanitized_object_name, #singularize_model_name

Constructor Details

#initialize(builder, method, options = {}) ⇒ Label

Initialize label object



13
14
15
16
# File 'lib/case_form/element/label.rb', line 13

def initialize(builder, method, options={})
  @method = method
  super(builder, options)
end

Instance Attribute Details

#methodObject

Returns the value of attribute method.



9
10
11
# File 'lib/case_form/element/label.rb', line 9

def method
  @method
end

Instance Method Details

#generateObject

Generate label with defined text and HTML options



20
21
22
# File 'lib/case_form/element/label.rb', line 20

def generate
  template.label(object_name, method, text, html_options)
end