Class: TaoForm::Components::MomentPicker::ResultComponent
- Inherits:
-
FieldComponent
- Object
- TaoOnRails::Components::Base
- FieldComponent
- TaoForm::Components::MomentPicker::ResultComponent
- Defined in:
- lib/tao_form/components/moment_picker/result_component.rb
Instance Attribute Summary collapse
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#input_type ⇒ Object
readonly
Returns the value of attribute input_type.
-
#placeholder ⇒ Object
readonly
Returns the value of attribute placeholder.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from FieldComponent
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(view, builder = nil, attribute_name = nil, options = {}) ⇒ ResultComponent
constructor
A new instance of ResultComponent.
- #render(&block) ⇒ Object
Constructor Details
#initialize(view, builder = nil, attribute_name = nil, options = {}) ⇒ ResultComponent
Returns a new instance of ResultComponent.
8 9 10 11 12 13 14 |
# File 'lib/tao_form/components/moment_picker/result_component.rb', line 8 def initialize view, builder = nil, attribute_name = nil, = {} super view, builder, attribute_name, @input_type = .delete(:input_type) @value = .delete(:value) @icon = .delete(:icon) @placeholder = .delete(:placeholder) end |
Instance Attribute Details
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
6 7 8 |
# File 'lib/tao_form/components/moment_picker/result_component.rb', line 6 def icon @icon end |
#input_type ⇒ Object (readonly)
Returns the value of attribute input_type.
6 7 8 |
# File 'lib/tao_form/components/moment_picker/result_component.rb', line 6 def input_type @input_type end |
#placeholder ⇒ Object (readonly)
Returns the value of attribute placeholder.
6 7 8 |
# File 'lib/tao_form/components/moment_picker/result_component.rb', line 6 def placeholder @placeholder end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/tao_form/components/moment_picker/result_component.rb', line 6 def value @value end |
Class Method Details
.component_name ⇒ Object
26 27 28 |
# File 'lib/tao_form/components/moment_picker/result_component.rb', line 26 def self.component_name :moment_picker_result end |
Instance Method Details
#render(&block) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/tao_form/components/moment_picker/result_component.rb', line 16 def render &block if block_given? super elsif builder && attribute_name super { builder.send :"#{input_type}_field", attribute_name, } end end |