0.0
No commit activity in last 3 years
No release in over 3 years
Making gets and multigets one and the same
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

thing_or_things

Making gets and multigets one and the same

Install

gem install thing_or_things

Usage

require 'thing_or_things'


def load_stuff(id_or_ids)
  thing_or_things(id_or_ids) do |ids|
    res = []

    # expensive multiget
    ids.each {|id| res[id] = id }

    res
  end
end


load_stuff 123
=> 123

load_stuff [ 4, 5, 6 ]
=> { 4 => 4, 5 => 5, 6 => 6 }