I'm having a problem in ruby and I can't seem to find the solution even though I know it's somehow possible. I have a class and I want to assign some variables to it in a do block like so:
tester = Person.new
tester do
:name => 'Andy'
:example => 'Example'
end
puts "#{tester.name}:#{tester.example}" #Should output 'Andy:Example'
Has anyone got any ideas? I apologise for my terrible way of explaining. I'm new to Ruby :)