Graham
6/4/2009 1:34:00 PM
Help please! I'm a Ruby newbie and can't get the variables in the following
script to write to a file (is it something to do with defining the
variables?).
# create variables
class Person
attr_accessor :name, :age
end
person_instance = Person.new
person_instance.name = "David"
person_instance.age= "37"
# write to an HTML file
File.open("test4.html", "w") do |f|
f.puts "<html><head></head><body><h3>person_instance.name
(person_instance.age), sat at the table</h3></body></html>"
end