{"id":17851649,"url":"https://github.com/derekstride/jsoncache","last_synced_at":"2025-03-20T09:30:29.743Z","repository":{"id":56879533,"uuid":"47569574","full_name":"DerekStride/jsoncache","owner":"DerekStride","description":"A simple JSON cache for caching data intended for use with JSON APIs.","archived":false,"fork":false,"pushed_at":"2016-10-09T19:22:02.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-09T09:16:30.757Z","etag":null,"topics":["cache","http","json","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DerekStride.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-07T17:57:32.000Z","updated_at":"2017-03-23T12:58:24.000Z","dependencies_parsed_at":"2022-08-20T11:40:40.861Z","dependency_job_id":null,"html_url":"https://github.com/DerekStride/jsoncache","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekStride%2Fjsoncache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekStride%2Fjsoncache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekStride%2Fjsoncache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekStride%2Fjsoncache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DerekStride","download_url":"https://codeload.github.com/DerekStride/jsoncache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244585577,"owners_count":20476760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","http","json","ruby"],"created_at":"2024-10-27T23:22:12.139Z","updated_at":"2025-03-20T09:30:29.328Z","avatar_url":"https://github.com/DerekStride.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONCache [![Build Status](https://travis-ci.org/DerekStride/jsoncache.svg?branch=dynamic-caching-based-on-arguments)](https://travis-ci.org/DerekStride/jsoncache)\n\nA simple JSON Cache for use with HTTP APIs.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'jsoncache'\n```\n\nAnd then execute:\n\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n\n```bash\n$ gem install jsoncache\n```\n\n## Usage\n\nInclude it in the class or module you want to use it in.\n\n```ruby\nextend JSONCache\n```\n\nTo enable caching for a method use the include class method `cache`.\n\n```ruby\ncache :expensive_method, expiry: 300\n```\n\nNote: the `cache` method call has to come after the method definition.\n\n## Example\n\n```ruby\nrequire 'jsoncache'\n\nClass A\n  extend JSONCache\n\n  def expensive_method(args)\n    # code\n  end\n\n  cache :expensive_method, expiry: 300\nend\n```\n\nThe cache method will the existing method and provide it with caching to the local filesystem. You can set a TTL (time to live) for the cache by setting the `expiry` value in seconds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekstride%2Fjsoncache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderekstride%2Fjsoncache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekstride%2Fjsoncache/lists"}