Skip to content

Instantly share code, notes, and snippets.

Created June 14, 2012 20:05
Show Gist options
  • Save anonymous/2932600 to your computer and use it in GitHub Desktop.
Save anonymous/2932600 to your computer and use it in GitHub Desktop.
testing activegist
module MX
@testvar = 'abc'
def ModTest
'This is ModTest.'
end
def self.ModVarTest
"This is ModVarTest. #{@testvar}"
end
def self.SetVar(v)
@testvar = v
end
end
class A
extend MX
def self.Test
puts 'This is test.'
end
def self.TestMixin
puts self.ModTest
end
def self.TestMixinVar
puts MX.ModVarTest
end
def self.SetMixinVar(v)
MX.SetVar(v)
end
end
A.Test
A.TestMixin
A.TestMixinVar
A.SetMixinVar('fghj')
A.TestMixinVar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment