I am 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, the interpreter currently returns "NoMethodError: undefined method 'description' for "Door":String" .
Edit
For instance:
door = Item.new( :name => "Door", :description => "a locked door" ) key = Item.new( :name => "Key", :description => "a key" )
source share