Sha256: f9d9e515c8ad1b8648987dd7f2fd1d1808c3e1ae1bae163d135fe8ea1677dc45
Contents?: true
Size: 317 Bytes
Versions: 7
Compression:
Stored size: 317 Bytes
Contents
class Object def attr_accessor_nn_one(sym) define_method(sym) do res = instance_variable_get("@#{sym}") raise "method #{sym} cannot return nil value" unless res res end attr_writer(sym) end def attr_accessor_nn(*args) args.flatten.each { |x| attr_accessor_nn_one(x) } end end
Version data entries
7 entries across 7 versions & 2 rubygems