Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 34 lines (23 sloc) 0.444 kB
db9f1ed @clarkware Initial import
authored
1 module Mixin
2
3 def self.included(base)
4 base.extend(ClassMethods)
5 base.send :include, InstanceMethods
6 end
7
8 module ClassMethods
9 attr_accessor :class_variable
10
11 def class_var(s)
12 self.class_variable = s
13 end
14 end
15
16 module InstanceMethods
17 def instance_method
18 puts self.class.class_variable
19 end
20 end
21
22 end
23
24 class Mike
25
26 include Mixin
27
28 class_var "bar"
29
30 end
31
32 m = Mike.new
33 m.instance_method
Something went wrong with that request. Please try again.