{"id":15472853,"url":"https://github.com/hackvan/mass-assignment","last_synced_at":"2025-06-17T18:38:08.538Z","repository":{"id":145341736,"uuid":"140618859","full_name":"hackvan/mass-assignment","owner":"hackvan","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-11T19:27:37.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T17:13:23.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackvan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-11T19:18:56.000Z","updated_at":"2018-07-11T19:27:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"b27a12d6-de69-4b85-990e-753d86375fc9","html_url":"https://github.com/hackvan/mass-assignment","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"2876ce5f9f35b1bd647533c92254d6936ad848c5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Fmass-assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Fmass-assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Fmass-assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Fmass-assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackvan","download_url":"https://codeload.github.com/hackvan/mass-assignment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240386530,"owners_count":19793193,"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-10-02T02:41:20.943Z","updated_at":"2025-02-23T22:21:41.914Z","avatar_url":"https://github.com/hackvan.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mass Assignment\n\n## Objectives\n\n1. Use keyword arguments to define an initialize method.\n2. Use mass assignment to metaprogram an initialize method. \n\n## Instructions\n\n* Create a Person class that accepts a hash upon initialization. The keys of the hash should conform to the attributes below: \n\nallowable properties: \n  \n```ruby\n:name, :birthday, :hair_color, :eye_color, :height, \n:weight, :handed, :complexion, :t_shirt_size, \n:wrist_size, :glove_size, :pant_length, :pant_width\n```\n\n  * Each key in the attributes hash will become a property of an initialized Person instance. So, you should make an `attr_accessor` for each of the above properties\n  \n  ex:\n\n```ruby\nbob_attributes = {name: \"Bob\", hair_color: \"Brown\"}\n\nbob = Person.new(bob_attributes)\nbob.name       # =\u003e \"Bob\"\nbob.hair_color # =\u003e \"Brown\"\n\nsusan_attributes = {name: \"Susan\", height: \"5'11\\\"\", eye_color: \"Green\"}\n\nsusan = Person.new(susan_attributes)\nsusan.name      # =\u003e \"Susan\"\nsusan.height    # =\u003e \"5'11\"\"\nsusan.eye_color # =\u003e \"Green\"\n```\n\n* Your initialize method should use iteration and the `.send` method to mass assign the value of each key/value pair to its associated key (i.e. method). Refer to the previous reading to help you solve this one.\n\n\u003cp data-visibility='hidden'\u003eView \u003ca href='https://learn.co/lessons/mass-assignment' title='Mass Assignment'\u003eMass Assignment\u003c/a\u003e on Learn.co and start learning to code for free.\u003c/p\u003e\n\n\u003cp class='util--hide'\u003eView \u003ca href='https://learn.co/lessons/mass-assignment'\u003eMass Assignment Lab\u003c/a\u003e on Learn.co and start learning to code for free.\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackvan%2Fmass-assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackvan%2Fmass-assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackvan%2Fmass-assignment/lists"}