this seems weird to me. Am I wrong to be able to expect to use a
method inside a shoes-derived class to assign a value to an instance
variable?
Check this out:
======
class BugTest < Shoes
url '/', :main
def assign_variable
info "assigning variable."
@foo = "bar"
info "self is #{self}. @foo is #...@foo}"
end
def main
title "main"
info "in main. self is #{self}. @foo is #...@foo}"
button "assign variable" do
assign_variable
visit '/'
end
end
end
Shoes.app
=====
You run this, click the button, and get the following on the console:
in main. self is (#<Class:0x12493b0>::BugTest). @foo is
assigning variable.
self is (#<Class:0x12493b0>::BugTest @foo="bar"). @foo is bar
in main. self is (#<Class:0x12493b0>::BugTest). @foo is
====
Where'd the value 'bar' in @foo go after the assign_variable method
returned?