Class: TaoForm::Components::MomentPicker::Base
- Inherits:
-
FieldComponent
- Object
- TaoOnRails::Components::Base
- FieldComponent
- TaoForm::Components::MomentPicker::Base
show all
- Defined in:
- lib/tao_form/components/moment_picker/base.rb
Instance Attribute Summary collapse
#attribute_name, #builder
Instance Method Summary
collapse
Constructor Details
#initialize(view, builder = nil, attribute_name = nil, options = {}) ⇒ Base
Returns a new instance of Base.
8
9
10
11
12
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 8
def initialize view, builder = nil, attribute_name = nil, options = {}
super view, builder, attribute_name, options
init_result_options
init_list_options
end
|
Instance Attribute Details
#block_for_render ⇒ Object
Returns the value of attribute block_for_render.
6
7
8
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 6
def block_for_render
@block_for_render
end
|
#list_options ⇒ Object
Returns the value of attribute list_options.
6
7
8
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 6
def list_options
@list_options
end
|
#result_options ⇒ Object
Returns the value of attribute result_options.
6
7
8
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 6
def result_options
@result_options
end
|
Instance Method Details
#default_segment ⇒ Object
23
24
25
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 23
def default_segment
end
|
15
16
17
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 15
def input_type
end
|
#placeholder ⇒ Object
42
43
44
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 42
def placeholder
@placeholder ||= options.delete(:placeholder) || t(:placeholder)
end
|
#render(&block) ⇒ Object
27
28
29
30
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 27
def render &block
@block_for_render = block
render_template 'moment_picker', &block
end
|
#render_result ⇒ Object
32
33
34
35
36
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 32
def render_result
view.tao_moment_picker_result(
builder, attribute_name, result_options, &block_for_render
)
end
|
#render_segment_list ⇒ Object
38
39
40
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 38
def render_segment_list
view.tao_moment_picker_segment_list list_options
end
|
#segments ⇒ Object
19
20
21
|
# File 'lib/tao_form/components/moment_picker/base.rb', line 19
def segments
end
|