{"id":13880060,"url":"https://github.com/fnando/simple_presenter","last_synced_at":"2025-07-16T16:30:44.283Z","repository":{"id":56895838,"uuid":"2590084","full_name":"fnando/simple_presenter","owner":"fnando","description":"A simple presenter/facade/decorator/whatever implementation.","archived":true,"fork":false,"pushed_at":"2015-10-09T02:49:21.000Z","size":159,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-09T10:47:32.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fnando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-17T06:58:21.000Z","updated_at":"2025-02-26T01:48:48.000Z","dependencies_parsed_at":"2022-08-20T17:10:24.969Z","dependency_job_id":null,"html_url":"https://github.com/fnando/simple_presenter","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/fnando/simple_presenter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fsimple_presenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fsimple_presenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fsimple_presenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fsimple_presenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnando","download_url":"https://codeload.github.com/fnando/simple_presenter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Fsimple_presenter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265524602,"owners_count":23782009,"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":[],"created_at":"2024-08-06T08:02:45.567Z","updated_at":"2025-07-16T16:30:43.967Z","avatar_url":"https://github.com/fnando.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# simple_presenter\n\n[![This project was superseded by https://github.com/fnando/burgundy.](http://messages.hellobits.com/warning.svg?message=This%20project%20was%20superseded%20by%20https%3A%2F%2Fgithub.com%2Ffnando%2Fburgundy.)](http://github.com/fnando/burgundy)\n\n## Installation\n\n```\ngem install simple_presenter\n```\n\n## Usage\n\n```ruby\nclass User \u003c ActiveRecord::Base\n  # implements the following attributes: name, email, password_hash, password_salt\nend\n\nclass UserPresenter \u003c Presenter\n  expose :name, :email\nend\n\nuser = UserPresenter.new(User.first)\nusers = UserPresenter.map(User.all)\n```\n\nIf you're using Simple Presenter within Rails, presenters also have access to:\n\n* route helpers: just use the `routes` or `r` methods\n* view helpers: just use the `helpers` or `h` methods\n* I18n methods: just use the `translate`, `t`, `localize` or `l` methods\n\nIf you want to to use `*_url` route methods, make sure you set the `default_url_options` option. You can use the `config.simple_presenter.default_url_options` method, which defaults to `config.action_mailer.default_url_options`. You can add something like the following to your `config/environments/development.rb`, for instance:\n\n```ruby\nconfig.simple_presenter.default_url_options = {:host =\u003e \"localhost:3000\"}\n```\n\nFor additional usage, check the specs.\n\n## TO-DO\n\n* Recognize ActiveRecord objects and automatically expose attributes used by url and form helpers (like `Model.model_name`, `Model#to_key`, and `Model#to_param`).\n* Override `respond_to?` to reflect exposed attributes.\n\n## Troubleshooting\n\nIf you're having problems because already have a class/module called Presenter that is conflicting with this gem, you can require the namespace and inherit from `SimplePresenter::Base`.\n\n```ruby\nrequire \"simple_presenter/namespace\"\n\nclass UserPresenter \u003c SimplePresenter::Base\nend\n```\n\nIf you're using Rails/Bundler or something like that, remember to override the `:require` option.\n\n  # Gemfile\n  source :rubygems\n\n  gem \"simple_presenter\", :require =\u003e \"simple_presenter/namespace\"\n\n## Maintainer\n\n* Nando Vieira (http://nandovieira.com.br)\n\n## License\n\n(The MIT License)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnando%2Fsimple_presenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnando%2Fsimple_presenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnando%2Fsimple_presenter/lists"}