I'm new to this but I have the following code:
when /^read (.+)$/
puts "Reading #{$1}:"
puts $1.description.downcase
I would like to use $1 as a variable that I can call methods on, currently the interpreter returns a "NoMethodError: undefined method 'description' for "Door":String"
.
Edit:
For example:
door = Item.new( :name => "Door", :description => "a locked door" )
key = Item.new( :name => "Key", :description => "a key" )