title: going back to basics - Instantiating classes
body: <p>Trying to understand instantiating better. I created a problem for myself, which i hope makes sense.</p>
  
  <p>There are 2 files: <code>test.rb</code> and <code>length.rb</code>.</p>
  
  <p>In <code>test.rb</code>, I want to create a box, and specify it's length, then print out it's length using "puts".</p>
  
  <p><code>length.rb</code> is where the instance variable length is created. I want to store the data there. I'm not sure if my understanding of it is right, but that's what i gathered from my back end course...</p>
  
  <p>So here are the codes. Many thanks in advance.</p>
  
  <p>Edit: sorry, the question is, how do i get the last code to run?</p>
  
  <p>the puts "the lenth of the rectangle is ---whatever length i input into the function/method"</p>
  
  <pre><code># test.rb
  
  require "./length.rb"
  
      def createLength
          puts "What is the length of the box?"
          length = gets.strip
  
          BoxLength.new( length )
      end
  
      box_one = createLength
  
      puts "the length of box_one is #{box_one.length}"
  
  
  # length.rb
  
  require "./test.rb"
  
      class BoxLength
  
          attr_accessor :length
  
          def initialize( length )
              @length = length
          end
  
      end
  </code></pre>