Namespace

Files

Paperclip::Ext::Class

Constants

EMPTY_INHERITABLE_ATTRIBUTES

Prevent this constant from being created multiple times

IVar

Public Class Methods

inheritable_attributes(klass) click to toggle source
# File lib/dm-paperclip/ext/class.rb, line 3
def self.inheritable_attributes(klass)
  unless klass.instance_variable_defined?(IVar)
    klass.instance_variable_set(IVar, EMPTY_INHERITABLE_ATTRIBUTES)
  end
  klass.instance_variable_get(IVar)
end
read_inheritable_attribute(klass, key) click to toggle source
# File lib/dm-paperclip/ext/class.rb, line 17
def self.read_inheritable_attribute(klass, key)
  inheritable_attributes(klass)[key]
end
reset_inheritable_attributes(klass) click to toggle source
# File lib/dm-paperclip/ext/class.rb, line 21
def self.reset_inheritable_attributes(klass)
  klass.instance_variable_set(IVar, EMPTY_INHERITABLE_ATTRIBUTES)
end
write_inheritable_attribute(klass, key, value) click to toggle source
# File lib/dm-paperclip/ext/class.rb, line 10
def self.write_inheritable_attribute(klass, key, value)
  if inheritable_attributes(klass).equal?(EMPTY_INHERITABLE_ATTRIBUTES)
    klass.instance_variable_set(IVar, {})
  end
  inheritable_attributes(klass)[key] = value
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.