lib/gamebox/lib/observable_attributes.rb
# singular form of has_attributes
# takes the symbol name and an optional default value
singular form of has_attributes
takes the symbol name and an optional default value
singular form of has_attributes takes the symbol name and an optional default value
def has_attribute(name, value=nil)
    @evented_attributes ||= []
    unless has_attribute? name
      @evented_attributes << name
      self.metaclass.send :kvo_attr_accessor, name
      self.define_singleton_method "#{name}?" do
        self.send name
      end
      self.send("#{name}=", value)
    end
  end
def has_attribute ( name , value = nil ) @evented_attributes ||= [ ] unless has_attribute? name @evented_attributes << name self . metaclass . send :kvo_attr_accessor , name self . define_singleton_method "#{name}?" do self . send name end self . send ( "#{name}=" , value ) end end
singular form of has_attributes
takes the symbol name and an optional default value
singular form of has_attributes takes the symbol name and an optional default value
name
<not_specific>
value
<not_specific>