attr_reader and attr_writer should return nil

parent 7ac68809
...@@ -8,6 +8,7 @@ class Module ...@@ -8,6 +8,7 @@ class Module
attr_name = '@'+name attr_name = '@'+name
define_method(name){self.instance_variable_get(attr_name)} define_method(name){self.instance_variable_get(attr_name)}
end end
nil
end end
# 15.2.2.4.14 # 15.2.2.4.14
def attr_writer(*names) def attr_writer(*names)
...@@ -19,6 +20,7 @@ class Module ...@@ -19,6 +20,7 @@ class Module
name = (name+"=").intern name = (name+"=").intern
define_method(name){|v|self.instance_variable_set(attr_name,v)} define_method(name){|v|self.instance_variable_set(attr_name,v)}
end end
nil
end end
# 15.2.2.4.12 # 15.2.2.4.12
def attr_accessor(*names) def attr_accessor(*names)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment