{"id":16451290,"url":"https://github.com/kirillshevch/caller","last_synced_at":"2025-09-17T19:31:07.077Z","repository":{"id":62554881,"uuid":"154866572","full_name":"kirillshevch/caller","owner":"kirillshevch","description":"Callable objects made easy","archived":false,"fork":false,"pushed_at":"2020-02-29T14:15:21.000Z","size":13,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T16:03:58.637Z","etag":null,"topics":["callable","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/kirillshevch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-26T16:56:25.000Z","updated_at":"2020-01-30T02:42:08.000Z","dependencies_parsed_at":"2022-11-03T05:15:33.067Z","dependency_job_id":null,"html_url":"https://github.com/kirillshevch/caller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillshevch%2Fcaller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillshevch%2Fcaller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillshevch%2Fcaller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillshevch%2Fcaller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirillshevch","download_url":"https://codeload.github.com/kirillshevch/caller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233418657,"owners_count":18673474,"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":["callable","ruby"],"created_at":"2024-10-11T10:08:14.841Z","updated_at":"2025-09-17T19:31:01.775Z","avatar_url":"https://github.com/kirillshevch.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caller\n\nGem which helps initialize class instance with `.call` method.\n\n```\n.call(*args) =\u003e #new.call(*args)\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'caller'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install caller\n\n## Usage\n\nDo you have some code like this?\n\n```ruby\nmodule Service\n  def call(*args)\n    new(*args).call\n  end\nend\n\nclass Printer\n  extend Service\n\n  def initialize(text)\n    @text = text\n  end\n\n  def call\n    @text\n  end\nend\n```\n\n\nLet's replace it with `caller`\n\n```ruby\nclass Printer\n  extend Caller\n\n  def call(text)\n    text\n  end\nend\n\nPrinter.call('Say caller')\n```\n\n## caller_for\n\nAssign other alias for the constructor with `caller_for` method\n\n```ruby\nclass Printer\n  extend Caller\n\n  caller_for :print\n\n  def print(text)\n    text\n  end\nend\n\nPrinter.print('Say caller')\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/kirillshevch/caller.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirillshevch%2Fcaller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirillshevch%2Fcaller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirillshevch%2Fcaller/lists"}