{"id":19123289,"url":"https://github.com/avinashbot/lazy_lazer","last_synced_at":"2025-07-24T07:02:27.541Z","repository":{"id":56880870,"uuid":"99269529","full_name":"avinashbot/lazy_lazer","owner":"avinashbot","description":"create custom lightweight lazily loaded data models using a simple dsl","archived":false,"fork":false,"pushed_at":"2017-10-03T15:42:02.000Z","size":130,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T12:14:47.585Z","etag":null,"topics":["lazy-loading","model","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/avinashbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-03T19:50:37.000Z","updated_at":"2018-01-31T06:23:35.000Z","dependencies_parsed_at":"2022-08-20T13:00:46.813Z","dependency_job_id":null,"html_url":"https://github.com/avinashbot/lazy_lazer","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/avinashbot/lazy_lazer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Flazy_lazer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Flazy_lazer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Flazy_lazer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Flazy_lazer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avinashbot","download_url":"https://codeload.github.com/avinashbot/lazy_lazer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Flazy_lazer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266806952,"owners_count":23987420,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["lazy-loading","model","ruby"],"created_at":"2024-11-09T05:25:00.968Z","updated_at":"2025-07-24T07:02:27.107Z","avatar_url":"https://github.com/avinashbot.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/avinashbot/lazy_lazer/master/logo.png\" width=\"500\"\u003e\n\u003c/p\u003e\n\n```ruby\nrequire 'lazy_lazer'\n\nclass User\n  include LazyLazer\n\n  property :name, :required\n  property :email, default: 'unknown@example.com'\n  property :created_at, from: :creation_time_utc, with: -\u003e(t) { Time.at(t) }\n  property :age, with: :to_i\n  property :twitter_handle, :nil\n  property :favorite_ice_cream\n\n  def say_flavor!\n    if exists_locally?(:favorite_ice_cream)\n      puts \"#{name} currently likes #{favorite_ice_cream}.\"\n    else\n      puts \"#{name} doesn't have a favorite ice cream flavor yet.\"\n    end\n  end\n\n  def try_another_flavor!\n    delete_attribute(:favorite_ice_cream)\n    not_fully_loaded!\n    puts \"#{name} just tried #{favorite_ice_cream}. They love it!\"\n  end\n\n  private\n\n  def lazer_reload\n    fully_loaded! # mark model as fully updated\n    { favorite_ice_cream: %w[vanilla strawberry chocolate].sample }\n  end\nend\n\nuser = User.new(name: 'Blinky', creation_time_utc: 1500000000, age: '21')\n\nuser.name           #=\u003e \"Blinky\"\nuser.email          #=\u003e \"unknown@example.com\"\nuser.created_at     #=\u003e 2017-07-14 03:40:00 +0100\nuser.age            #=\u003e 21\nuser.twitter_handle #=\u003e nil\n\nuser.favorite_ice_cream         #=\u003e \"chocolate\"\nuser.favorite_ice_cream         #=\u003e \"chocolate\"\nuser.reload.favorite_ice_cream  #=\u003e \"vanilla\"\n\nuser.say_flavor!         #=\u003e Blinky currently likes vanilla.\nuser.try_another_flavor! #=\u003e Blinky just tried strawberry. They love it!\n```\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"http://www.rubydoc.info/github/avinashbot/lazy_lazer/master\"\u003edocumentation\u003c/a\u003e -\n\u003ca href=\"https://github.com/avinashbot/lazy_lazer/blob/master/CONTRIBUTING.md\"\u003econtributing\u003c/a\u003e -\n\u003ca href=\"https://github.com/avinashbot/lazy_lazer/blob/master/LICENSE.txt\"\u003emit licensed\u003c/a\u003e\n\u003cbr\u003e\ncreated for \u003ca href=\"https://github.com/avinashbot/redd\"\u003eredd\u003c/a\u003e -\nlogo font is \u003ca href=\"https://www.behance.net/gallery/3588289/Zaguatica\"\u003ezaguatica\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinashbot%2Flazy_lazer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favinashbot%2Flazy_lazer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinashbot%2Flazy_lazer/lists"}