Class: VCFB::Component::Label

Inherits:
Base
  • Object
show all
Defined in:
lib/vcfb/component/label.rb

Instance Method Summary collapse

Methods inherited from Base

#collection_check_boxes, #collection_radio_buttons

Constructor Details

#initialize(form, method, text = nil, options = {}) ⇒ Label

Returns a new instance of Label.



7
8
9
10
11
12
13
14
# File 'lib/vcfb/component/label.rb', line 7

def initialize(form, method, text = nil, options = {})
  run_callbacks :initialize do
    @form = form
    @method = method
    @text = text
    @options = defined?(TagOptions::Hash) ? TagOptions::Hash.new(options) : options
  end
end

Instance Method Details

#form_element(options = {}, &block) ⇒ Object



16
17
18
# File 'lib/vcfb/component/label.rb', line 16

def form_element(options = {}, &block)
  label(@form.object_name, @method, options, &block)
end