{"id":15651801,"url":"https://github.com/jnunemaker/scam","last_synced_at":"2025-08-17T07:02:58.470Z","repository":{"id":1264621,"uuid":"1203590","full_name":"jnunemaker/scam","owner":"jnunemaker","description":"Really basic fake model for doing types in memory","archived":false,"fork":false,"pushed_at":"2011-09-17T01:53:12.000Z","size":723,"stargazers_count":32,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-30T22:44:57.879Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"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/jnunemaker.png","metadata":{"files":{"readme":"README.rdoc","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":"2010-12-28T18:14:15.000Z","updated_at":"2021-01-01T01:41:14.000Z","dependencies_parsed_at":"2022-08-16T12:50:21.782Z","dependency_job_id":null,"html_url":"https://github.com/jnunemaker/scam","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jnunemaker/scam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Fscam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Fscam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Fscam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Fscam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jnunemaker","download_url":"https://codeload.github.com/jnunemaker/scam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Fscam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270816193,"owners_count":24650752,"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-08-17T02:00:09.016Z","response_time":129,"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":[],"created_at":"2024-10-03T12:40:12.741Z","updated_at":"2025-08-17T07:02:58.339Z","avatar_url":"https://github.com/jnunemaker.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Scam\n\nReally basic model-ish thing for creating different types in your application easily.\n\nI use this whenever I want something to do psuedo belongs to/has many relationships, but do not want to back a model with a database as the data does not change often, if ever.\n\n== Usage\n\nJust create a class and include scam.\n\n    class FeedTemplate\n      include Scam\n\n      attr_accessor :title, :icon, :instructions, :template, :format, :label\n\n      def expand(value)\n        url = template.gsub('{value}', URI.escape(value))\n        url = \"http://#{url}\" if url !~ /https?\\:\\/\\//\n        url\n      end\n\n      def parse(body)\n        case format\n          when 'json'\n            ActiveSupport::JSON.decode(body)\n          when 'feed'\n            Feedzirra::Feed.parse(body).to_hash\n        end\n      end\n    end\n\n    FeedTemplate.create({\n      :id           =\u003e 1,\n      :title        =\u003e 'Twitter',\n      :label        =\u003e 'Twitter Username',\n      :icon         =\u003e 'twitter',\n      :instructions =\u003e 'Enter your Twitter username',\n      :format       =\u003e 'json',\n      :template     =\u003e 'http://twitter.com/statuses/user_timeline/{value}.json',\n    })\n\nAttributes are just defined using attr_accessor. :id is added when you include Scam.\n\n== Note on Patches/Pull Requests\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don't break it in a\n  future version unintentionally.\n* Commit, do not mess with rakefile, version, or history.\n  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)\n* Send me a pull request. Bonus points for topic branches.\n\n== Copyright\n\nCopyright (c) 2010 John Nunemaker. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnunemaker%2Fscam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjnunemaker%2Fscam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnunemaker%2Fscam/lists"}