It's as the question title says, I have an included hook in a module:
def self.included(base)
puts 'included'
base.extend API
end
My API requires certain variables on the object to exists but none of them are being created.
I've tried:
base.variable_name = []
%x|#{base}.variable_name = []|
base.instance_variable_set(:@variable_name,[])
base.instance_exec{@variable_name = []}
- 1-2 inside of
base.instance_exec
but usingself
instead ofbase
Yet none of them work, the console just complains that variable_name=
doesn't exist.
What.the.hell?
How do I get the variable to exist on the base object inside of the included
hook?