Module: ProMotion::Table::Utils
- Included in:
- GroupedTableScreen, ProMotion::Table, ProMotion::TableData
- Defined in:
- lib/ProMotion/table/table_utils.rb
Instance Method Summary collapse
-
#array_all_members_of?(arr, klass) ⇒ Boolean
Determines if all members of an array are a certain class.
- #index_path_to_section_index(params) ⇒ Object
Instance Method Details
#array_all_members_of?(arr, klass) ⇒ Boolean
Determines if all members of an array are a certain class
13 14 15 |
# File 'lib/ProMotion/table/table_utils.rb', line 13 def array_all_members_of?(arr, klass) arr.select{ |e| e.is_a?(klass) }.length == arr.length end |
#index_path_to_section_index(params) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/ProMotion/table/table_utils.rb', line 4 def index_path_to_section_index(params) if params.is_a?(Hash) && params[:index_path] params[:section] = params[:index_path].section params[:index] = params[:index_path].row end params end |