Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 466 Bytes
module Timeline
module Helpers
class DecodeException < StandardError; end
def encode(object)
::MultiJson.encode(object)
end
def decode(object)
return unless object
begin
::MultiJson.decode(object)
rescue ::MultiJson::DecodeError => e
raise DecodeException, e
end
end
def get_list(options={})
Timeline.redis.lrange options[:list_name], options[:start], options[:end]
end
end
end