# Mass Assignment Lab

## Mass Assignment

### Objectives

1. Use keyword arguments to define an initialize method.
2. Use mass assignment to metaprogram an initialize method.

### Instructions

* Create a Person class that accepts a hash upon initialization. The keys of the hash should conform to the attributes below:

allowable properties:

```
:name, :birthday, :hair_color, :eye_color, :height, 
:weight, :handed, :complexion, :t_shirt_size, 
:wrist_size, :glove_size, :pant_length, :pant_width
```

* 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

ex:

```
bob_attributes = {name: "Bob", hair_color: "Brown"}

bob = Person.new(bob_attributes)
bob.name       # => "Bob"
bob.hair_color # => "Brown"

susan_attributes = {name: "Susan", height: "5'11\"", eye_color: "Green"}

susan = Person.new(susan_attributes)
susan.name      # => "Susan"
susan.height    # => "5'11""
susan.eye_color # => "Green"
```

* 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.

View [Mass Assignment](https://learn.co/lessons/mass-assignment) on Learn.co and start learning to code for free.

View [Mass Assignment Lab](https://learn.co/lessons/mass-assignment) on Learn.co and start learning to code for free.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://certil-remy.gitbook.io/learn/oop-ruby/untitled-39.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
