Add scope pills to switch through JSON responses

I cannot use 1.month, 4.days, 1.year. Its giving me an error: NoMethodError: undefined method `days' for 1:Fixnum