Module: Gemmy::Patches::ObjectPatch::InstanceMethods::AttrSingletonWriter
- Defined in:
- lib/gemmy/patches/object_patch.rb
Instance Method Summary collapse
Instance Method Details
#attr_singleton_writer(*args) ⇒ Object
facets
233 234 235 236 237 238 |
# File 'lib/gemmy/patches/object_patch.rb', line 233 def attr_singleton_writer(*args) #h, a = *args.partition{|a| Hash===a} (class << self ; self ; end).send( :attr_writer, *args ) #(class << self ; self ; end).send( :attr_writer, *h.keys ) #h.each { |k,v| instance_variable_set("@#{k}", v) } end |