#Attr Methods

# I worked on this challenge [by myself, with:]

# I spent [#] hours on this challenge.


class NameData
  attr_accessor :name
  def initialize
    @name = "CJ"
end
end

class Greetings
  attr_accessor :hello
  def intialize
    @hello = "Hi #{NameData.new.name}!  Pleased to meet you."
end
end

greet = Greetings.new
puts greet.hello


# Reflection

# What are these methods doing?
# How are they modifying or returning the value of instance variables?
# So first you're defining the class and instance variables you're using (Kim, her age and job) and then changing them, creating a new profile in the process. Sleep seems to be a way of pausing between methods.

# What changed between the last release and this release?
# What was replaced?
# Is this code simpler than the last?
# So instead of the method what_is_age, you have the attr_reader :age at the top of the screen (line 5).  They both do the same job -- there seems to be no noticeable difference in what is printed to the screen -- but, code-wise, attr_reader requires less space.  Seems more effective to me.

# What changed between the last release and this release?
# What was replaced?
# Is this code simpler than the last?
# As with Release 2, no changes to what's printed to screen.  Up top on line 6, attr_writer : age was entered. This seems to allow for a method to be called and instance variable to be changed.  In terms of simplicity, yes, it does seem so but I don't know if there's a way to consolidate these attr lines.

#What is a reader method?
# A method that allows for the user to view an instance variable outside of its class.
# What is a writer method?
# A method that allows for the user to change data (and also access data outside of its class).
# What do the attr methods do for you?
# They seem to make coder cleaner; uses up less space.  They also let you use methods beyond limited parameters.
# Should you always use an accessor to cover your bases? Why or Why not?
# I don't think so. There will be instances when an accessor is handy and, other times, you may not want to allow data to be changed.
# What is confusing to you about these methods?
# They seem understandable enough; I just need more practice with them.  I liked how this exercise required me to go step by step, look at the code, understand subtle differences, and also see how I could refactor better. We weren't just thrown into the assignment.