<commit_before>*attr_ attributes*

**Learning Competencies**
  - Understand what attr_reader, attr_writer, and attr_accessor are
  - Understand what getter and setter methods are
  - Use the attr_ methods to simplify your code
  - Use the attr_ methods to communicate data between classes

**Summary**

If you have looked at Ruby or Ruby on Rails code before, you may have noticed this strange section of code under the class declaration. We are going to demystify and talk about the purpose of attr_reader/writer/accessor.

When talking about the different attr_ attributes we are really talking about getter and setter methods.

attr_reader is a getter which means that it just returns a value, but you can not change it.

attr_writer is a setter which means that you can change the value of the variable, but it is not readable.

attr_accessor is both a getter and a setter. We can now return and change the value of the variable.

So knowing this, why not just make everything attr_accessor? Generally we want things to be as closed to change as possible. having all instance variables changeable when we really just want them read could lead to hard to debug problems down the line. It is a safeguard against accidentally giving other methods and classes too much access to the inner workings of others. Read Practical Obect Oriented Design in Ruby if you want to learn more about the basics of software architecture.

**Release 0**

Open the Release0.rb and read the code and especially the comments. Is there anything that you see that you do not understand? Look up or ask questions about anything unfamiliar.

Run the code. Do you notice what is changing?

**Release 1**

Open Release1.rb after you finished the instructions for release0.rb. Read the comments and code. Do you notice where the code changed from the last release?

**Release 2**
<commit_msg>changed power words to more powerful words<commit_after>*attr_ attributes*

**Learning Competencies**
  - Explain what attr_reader, attr_writer, and attr_accessor are
  - Express what getter and setter methods are
  - Use the attr_ methods to simplify your code
  - Use the attr_ methods to communicate data between classes

**Summary**

If you have looked at Ruby or Ruby on Rails code before, you may have noticed this strange section of code under the class declaration. We are going to demystify and talk about the purpose of attr_reader/writer/accessor.

When talking about the different attr_ attributes we are really talking about getter and setter methods.

attr_reader is a getter which means that it just returns a value, but you can not change it.

attr_writer is a setter which means that you can change the value of the variable, but it is not readable.

attr_accessor is both a getter and a setter. We can now return and change the value of the variable.

So knowing this, why not just make everything attr_accessor? Generally we want things to be as closed to change as possible. having all instance variables changeable when we really just want them read could lead to hard to debug problems down the line. It is a safeguard against accidentally giving other methods and classes too much access to the inner workings of others. Read Practical Obect Oriented Design in Ruby if you want to learn more about the basics of software architecture.

**Release 0**

Open the Release0.rb and read the code and especially the comments. Is there anything that you see that you do not understand? Look up or ask questions about anything unfamiliar.

Run the code. Do you notice what is changing?

**Release 1**

Open Release1.rb after you finished the instructions for release0.rb. Read the comments and code. Do you notice where the code changed from the last release?

**Release 2**

{'fraction_non_alphanumeric': 0.03195739014647137, 'fraction_numerical': 0.003195739014647137, 'mean_word_length': 4.327659574468085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2624281', 'n_tokens_mistral': 912, 'n_tokens_neox': 887, 'n_words': 602}