Class: TaoForm::Components::MomentPicker::Base
- Inherits:
-
FieldComponent
- Object
- TaoOnRails::Components::Base
- FieldComponent
- TaoForm::Components::MomentPicker::Base
- Defined in:
- lib/tao_form/components/moment_picker/base.rb
Direct Known Subclasses
DatePickerComponent, TaoForm::Components::MonthPickerComponent, TimePickerComponent
Instance Attribute Summary collapse
-
#block_for_render ⇒ Object
readonly
Returns the value of attribute block_for_render.
-
#disabled ⇒ Object
readonly
Returns the value of attribute disabled.
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
-
#placeholder ⇒ Object
readonly
Returns the value of attribute placeholder.
Attributes inherited from FieldComponent
Instance Method Summary collapse
- #default_segment ⇒ Object
-
#initialize(view, builder, attribute_name, options = {}, html_options = {}) ⇒ Base
constructor
A new instance of Base.
- #input_type ⇒ Object
- #render(&block) ⇒ Object
- #render_result ⇒ Object
- #render_segment_list ⇒ Object
- #segments ⇒ Object
Constructor Details
#initialize(view, builder, attribute_name, options = {}, html_options = {}) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 12 def initialize view, builder, attribute_name, = {}, = {} super view, builder, attribute_name, @html_options = , @disabled = @html_options[:disabled].presence || false end |
Instance Attribute Details
#block_for_render ⇒ Object (readonly)
Returns the value of attribute block_for_render.
10 11 12 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 10 def block_for_render @block_for_render end |
#disabled ⇒ Object (readonly)
Returns the value of attribute disabled.
10 11 12 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 10 def disabled @disabled end |
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
10 11 12 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 10 def @html_options end |
#placeholder ⇒ Object (readonly)
Returns the value of attribute placeholder.
10 11 12 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 10 def placeholder @placeholder end |
Instance Method Details
#default_segment ⇒ Object
26 27 28 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 26 def default_segment # to be implemented end |
#input_type ⇒ Object
18 19 20 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 18 def input_type # to be implemented end |
#render(&block) ⇒ Object
30 31 32 33 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 30 def render &block @block_for_render = block render_template 'moment_picker', &block end |
#render_result ⇒ Object
35 36 37 38 39 40 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 35 def render_result view.tao_moment_picker_result( builder, attribute_name, input_type: input_type, icon: [:icon], placeholder: placeholder, disabled: disabled, &block_for_render ) end |
#render_segment_list ⇒ Object
42 43 44 45 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 42 def render_segment_list view.tao_moment_picker_segment_list segments: segments, default_segment: default_segment end |
#segments ⇒ Object
22 23 24 |
# File 'lib/tao_form/components/moment_picker/base.rb', line 22 def segments # to be implemented end |