Class: Array
Instance Method Summary collapse
Instance Method Details
#present? ⇒ Boolean
40 41 42 |
# File 'lib/ki/utils/extra_ruby.rb', line 40 def present? !nil? && !empty? end |
#stringify_ids ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ki/utils/extra_ruby.rb', line 26 def stringify_ids collect do |e| if e['_id'] e['id'] = e['_id'].to_s e.delete('_id') end if e[:_id] e['id'] = e[:_id].to_s e.delete(:_id) end e end end |