Skip to content

Instantly share code, notes, and snippets.

@jseakle
Created October 7, 2013 21:43
Show Gist options
  • Save jseakle/6875446 to your computer and use it in GitHub Desktop.
Save jseakle/6875446 to your computer and use it in GitHub Desktop.
def find(id)
@source.find(id)
end
def find_all(ids)
@source.find_all(ids)
end
------------------
def find(id)
if(id.is_a? Array)
find_all(ids)
end
@source.find(id)
end
private
find_all(ids)
@source.find_all(ids)
end
-------------------
def find(id_or_id_array)
return find_all(id_or_id_array) if id_or_id_array.is_a? Array
@source.find(id_or_id_array)
end
private
find_all(ids)
@source.find_all(ids)
end
-------------------
def find(id_or_id_array)
if id_or_id_array.is_a? Array
id_array = id_or_id_array
return find_all(id_array)
end
id = id_or_id_array
@source.find(id)
end
private
find_all(ids)
@source.find_all(ids)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment