class Array

Public Instance Methods

present?() click to toggle source
# File lib/ki/utils/extra_ruby.rb, line 40
def present?
  !nil? && !empty?
end
stringify_ids() click to toggle source
# 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