module Gemmy::Patches::ObjectPatch::InstanceMethods::AttrSingletonAccessor
Public Instance Methods
attr_singleton_accessor(*args)
click to toggle source
facets obj = Object.new obj.attr_singleton_accessor :x, :y
# File lib/gemmy/patches/object_patch.rb, line 213 def attr_singleton_accessor(*args) #h, a = *args.partition{|a| Hash===a} (class << self ; self ; end).send( :attr_accessor, *args ) #(class << self ; self ; end).send( :attr_accessor, *h.keys ) #h.each { |k,v| instance_variable_set("@#{k}", v) } end