Ask a Question related to Ruby, Design and Development.
-
Simon Strandgaard #1
extending instance and accessing scope
Often I need to pass variables from that scope in which I
extend an instance.. I wonder if it can be done simpler?
tree = TreeBuilder.new
node_rep = tree.lookup(3)
class << value
attr_accessor :future_input # is this necessary?
def test
@input = @future_input # is this necessary?
super
end
end
value.future_input = node_rep # is this necessary?
value.test
assert_equal(node_rep, value.output)
As you can see there is 3 lines which is dealing with passing a variable
from parent scope into the instance. I find this cumbersome.
Can it be done simpler ?
--
Simon Strandgaard
Simon Strandgaard Guest
-
Administrative Instance now looks like Instance Manager
I have a test server with several instances. All was well until I tried the following. I wanted to reduce the size of one of the instances. The... -
Extending Contribute - is it possible?
Hi folks, My client is using Readspeaker to allow for text->speech (http://readspeaker.episerverhotell.net/default.aspx?id=219) To link... -
Extending CF PoP.
Is there anyway to extend CFPoP to support additional encoding types? I am getting ' java.io.UnsupportedEncodingException: iso-3979-1. ' Could... -
Problem with sessions (in global scope vs class scope)
Hello, i'me having a wierd problems with sessions. PHP 4.3.3, Register globals is on, and the sessions module is installed. if i have a page like... -
extending flash
has anyone had experience or knows whether it is possible to create a local file browser for Flash by building java extensions using the generator...



Reply With Quote

