Skip to content

Method Chaining and Lazy Evaluation

Compare
Choose a tag to compare
@leesharma leesharma released this 04 May 19:48
· 37 commits to main since this release

Updates

This release introduces many breaking changes to the codebase. Since the gem is still in development (v0.x.x), the major version has not increased.

The major goal of this release was refactoring and adding method chaining and lazy evaluation. Additionally, results can now be limited by overview/category/activity name as well as document name,.

Queries can now be formed with the following syntax:

client = Rescuetime::Client.new RESCUETIME_API_KEY
#=> <#Rescuetime::Client:...>

# Build the query
activities = client.activities.from(1.week.ago).where(name: 'github.com').format('csv')
#=> <#Rescuetime::Collection:...>

# Perform the query with #all or an enumerable method (#each, #map, #any?, etc.)
activities.all
#=> <#CSV:...>