Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6d3b35e064
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (26 sloc) 0.565 kb
class Module
# 15.2.2.4.13
def attr_reader(*names)
names.each{|name|
name2 = ('@'+name.to_s).intern
define_method(name){self.instance_variable_get(name2)}
}
end
# 15.2.2.4.14
def attr_writer(*names)
names.each{|name|
name2 = ('@'+name.to_s).intern
name = (name.to_s+"=").intern
define_method(name){|v|self.instance_variable_set(name2,v)}
}
end
# 15.2.2.4.12
def attr_accessor(*names)
attr_reader(*names)
attr_writer(*names)
end
# 15.2.2.4.11
def attr(name)
attr_reader(name)
end
end
Jump to Line
Something went wrong with that request. Please try again.