title: What is the Ruby equivalent for Rails' "has_one" method?
body: <p>I am writing a Ruby application. In there I have two classes, that have a 1:1 relation. In Rails I would use ActiveRecord's <code>has_one</code> method on each function. But in Ruby, and without a database, I am not sure what to do.</p>
  
  <p>How do I define relations / associations between classes in Ruby? </p>
  
  <p>Edit: 
  This is not about a specific problem I have at the moment. I just wondered how I would express Rails <code>has_one</code> (respectively <code>has_many</code>, <code>belongs_to</code>) in pure Ruby code. The two classes I mentioned above are:
  1. A class that runs a search algorithm.
  2. A class that I use to handle user input that I need during the search process and that also displays results of intermediate steps and statistics.</p>
  
  <p>Maybe what I am asking for doesn't make sense as it can be expressed without a dedicated method like <code>has_one</code>? Or because it is never needed without a DB? </p>