Class: TaoUi::Components::Table::BaseBuilder
- Inherits:
-
Object
- Object
- TaoUi::Components::Table::BaseBuilder
- Defined in:
- lib/tao_ui/components/table/base_builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#expandable ⇒ Object
readonly
Returns the value of attribute expandable.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#selectable ⇒ Object
readonly
Returns the value of attribute selectable.
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
-
#initialize(view, options = {}) ⇒ BaseBuilder
constructor
A new instance of BaseBuilder.
- #merge_options(options, other_options) ⇒ Object
Constructor Details
#initialize(view, options = {}) ⇒ BaseBuilder
Returns a new instance of BaseBuilder.
9 10 11 12 13 14 |
# File 'lib/tao_ui/components/table/base_builder.rb', line 9 def initialize view, = {} @view = view = = [:expandable].presence || false @selectable = [:selectable].presence || false end |
Instance Attribute Details
#expandable ⇒ Object (readonly)
Returns the value of attribute expandable.
7 8 9 |
# File 'lib/tao_ui/components/table/base_builder.rb', line 7 def end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/tao_ui/components/table/base_builder.rb', line 7 def end |
#selectable ⇒ Object (readonly)
Returns the value of attribute selectable.
7 8 9 |
# File 'lib/tao_ui/components/table/base_builder.rb', line 7 def selectable @selectable end |
#view ⇒ Object (readonly)
Returns the value of attribute view.
7 8 9 |
# File 'lib/tao_ui/components/table/base_builder.rb', line 7 def view @view end |
Instance Method Details
#merge_options(options, other_options) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tao_ui/components/table/base_builder.rb', line 16 def , .merge() { |key, old_val, new_val| if key.to_s == 'class' old_val = old_val.split(' ') if old_val.is_a? String new_val = new_val.split(' ') if new_val.is_a? String Array(old_val) + Array(new_val) elsif old_val.is_a?(Hash) && old_val.is_a?(Hash) old_val.merge! new_val else new_val end } end |