balanced / balanced-ruby

Balanced API library in ruby.
MIT License
111 stars 47 forks source link

Support for date-range queries #112

Open ajsharp opened 11 years ago

ajsharp commented 11 years ago

You can do this manually already, it'd be great if the client made it a little easier:

Balanced::Transaction.paginate("created_at[>=]" => "#{1.day.ago.iso8601}")
ajsharp commented 11 years ago

Possible interfaces:

t1 = Time.new(2013, 7, 25) 
t2 = Time.new(2013, 7, 24)

Balanced::Transaction.paginate(:before => t1, :after => t2)

Balanced::Transaction.paginate.before(t1).after(t2)

Balanced::Transaction.paginate.between(t1, t2)

Obviously, the last two options would require some type of scoping support in general.