Netzke::Inheritance::ClassMethods

Public Instance Methods

class_ancestors() click to toggle source

All ancestor classes in the Netzke class hierarchy (i.e. up to Netzke::Base)

# File lib/netzke/inheritance.rb, line 7
def class_ancestors
  if self == Netzke::Base
    []
  else
    superclass.class_ancestors + [self]
  end
end
read_clean_inheritable_array(attr_name) click to toggle source

Same as read_inheritable_attribute returning a hash, but returns empty hash when it’s equal to superclass’s

# File lib/netzke/inheritance.rb, line 23
def read_clean_inheritable_array(attr_name)
  res = read_inheritable_attribute(attr_name) || []
  # We don't want here any values from the superclass (which is the consequence of using inheritable attributes).
  res == self.superclass.read_inheritable_attribute(attr_name) ? [] : res
end
read_clean_inheritable_hash(attr_name) click to toggle source

Same as read_inheritable_attribute returning a hash, but returns empty hash when it’s equal to superclass’s

# File lib/netzke/inheritance.rb, line 16
def read_clean_inheritable_hash(attr_name)
  res = read_inheritable_attribute(attr_name) || {}
  # We don't want here any values from the superclass (which is the consequence of using inheritable attributes).
  res == self.superclass.read_inheritable_attribute(attr_name) ? {} : res
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.