title: call a method from another file in ruby
body: <p>Hello I'm new to programming and I started with ruby. I'm trying to do my first program. I found online this code that generate a dice roll</p>
  
  <pre><code>class Die
    def initialize(sides)
      @sides = sides
    end
  
    def generate_die_roll
      rand(@sides) + 1
    end
  
    def roll(number=1)
      roll_array = []
      number.times do
        roll_array &lt;&lt; generate_die_roll
      end
      total = 0
      roll_array.each do |roll|
        new_total = total + roll
        total = new_total
      end
     total
    end
  end
  </code></pre>
  
  <p>and I would like to use in they way that if the number generated is inferior o equal to another print something otherwise something else.
  It's probably very easy but i'm trying in every way and now I will need some help please.
  that's my code:</p>
  
  <pre><code>require "./newdado.rb"
  energia_vitale = 30
  puts "Lancia un dado scrivendo (D) da sommare alla tua Energia Vitale iniziale di #{energia_vitale} punti"
  scelta = gets.chomp
  
  case scelta
  when "D"
  
  SIX_SIDED_DIE = "#{Die.new(6)}"
    values = Array[]
  values.push(SIX_SIDED_DIE.roll)
    puts values
  if values &lt; 2
    puts "c"
  else puts "b"
  end
  end
  </code></pre>
  
  <p>when I run it i receive this error
  <em>C:/Users/fix/workspace/D&amp;D Ruby/energia vitale.rb:11:in <code>&lt;main&gt;': undefined method</code>roll' for "#":String (NoMethodError)</em></p>
  
  <p>Sorry to bother the community with this beginner problem                         </p>