Module: Compass::Configuration::Inheritance::InstanceMethods

### Home Classes Methods

### In Files

- lib/compass/configuration/inheritance.rb

### Methods

- #any_attributes_set?
- #chain
- #debug
- #default_for
- #inherit_from!
- #method_missing
- #on_top!
- #raw
- #read
- #read_without_default
- #reset_inheritance!
- #respond_to?
- #set?
- #set_top_level
- #unset!
- #with_defaults

### Class/Module Index

Quicksearch

- Compass
- Compass::BrowserSupport
- Compass::Configuration
- Compass::Configuration::Adapters
- Compass::Configuration::Data
- Compass::Configuration::Defaults
- Compass::Configuration::Inheritance
- Compass::Configuration::Inheritance::ClassMethods
- Compass::Configuration::Inheritance::ClassMethods::ArrayProxy
- Compass::Configuration::Inheritance::InstanceMethods
- Compass::Configuration::Paths
- Compass::Configuration::Watch
- Compass::Core
- Compass::Core::CanIUse
- Compass::Core::SassExtensions
- Compass::Core::SassExtensions::Functions
- Compass::Core::SassExtensions::Functions::Colors
- Compass::Core::SassExtensions::Functions::Configuration
- Compass::Core::SassExtensions::Functions::Constants
- Compass::Core::SassExtensions::Functions::CrossBrowserSupport
- Compass::Core::SassExtensions::Functions::CrossBrowserSupport::CSS2FallbackValue
- Compass::Core::SassExtensions::Functions::Display
- Compass::Core::SassExtensions::Functions::Enumerate
- Compass::Core::SassExtensions::Functions::Env
- Compass::Core::SassExtensions::Functions::Files
- Compass::Core::SassExtensions::Functions::FontFiles
- Compass::Core::SassExtensions::Functions::GradientSupport
- Compass::Core::SassExtensions::Functions::GradientSupport::Assertions
- Compass::Core::SassExtensions::Functions::GradientSupport::CSS3AngleToSVGConverter
- Compass::Core::SassExtensions::Functions::GradientSupport::ColorStop
- Compass::Core::SassExtensions::Functions::GradientSupport::Functions
- Compass::Core::SassExtensions::Functions::GradientSupport::Gradient
- Compass::Core::SassExtensions::Functions::GradientSupport::Gradient::ClassMethods
- Compass::Core::SassExtensions::Functions::GradientSupport::LinearGradient
- Compass::Core::SassExtensions::Functions::GradientSupport::RadialGradient
- Compass::Core::SassExtensions::Functions::ImageSize
- Compass::Core::SassExtensions::Functions::ImageSize::ImageProperties
- Compass::Core::SassExtensions::Functions::ImageSize::JPEG
- Compass::Core::SassExtensions::Functions::InlineImage
- Compass::Core::SassExtensions::Functions::Lists
- Compass::Core::SassExtensions::Functions::Math
- Compass::Core::SassExtensions::Functions::SassDeclarationHelper
- Compass::Core::SassExtensions::Functions::Selectors
- Compass::Core::SassExtensions::Functions::Urls
- Compass::Core::SassExtensions::Functions::Urls::FontUrl
- Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl
- Compass::Core::SassExtensions::Functions::Urls::ImageUrl
- Compass::Core::SassExtensions::Functions::Urls::StylesheetUrl
- Compass::Error
- Compass::Frameworks
- Compass::Frameworks::Framework
- Compass::HasDeprecatedConstantsFromCore
- Compass::SassExtensions
- Compass::SassExtensions::Functions
- Compass::Util
- Sass
- Sass::Script
- Sass::Script::CrossBrowserFunctionCall
- Sass::Script::Funcall
- Sass::Script::Functions
- Sass::Script::Functions::EvaluationContext
- Sass::Script::HasSimpleCrossBrowserFunctionSupport
- Sass::Script::List
- Sass::Script::Value
- Sass::Script::Value::ArgList
- Sass::Script::Value::Base
- Sass::Script::Value::List
- Sass::Script::Value::Map
- Sass::Tree
- Sass::Tree::Node

No matching classes.

# Compass::Configuration::Inheritance::InstanceMethods

### Public Instance Methods

any_attributes_set?() click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 223
    def any_attributes_set?
      @set_attributes && @set_attributes.size > 0
    end

chain() click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 281
    def chain
      instances = [self]
      instances << instances.last.inherited_data while instances.last.inherited_data
      instances
    end

debug() click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 287
    def debug
      normalized_attrs = {}
      (ATTRIBUTES + ARRAY_ATTRIBUTES).each do |prop|
        values = []
        chain.each do |instance|
          values << {
            :raw => (instance.send("raw_#{prop}") rescue nil),
            :value => (instance.send("#{prop}_without_default") rescue nil),
            :default => (instance.send("default_#{prop}") rescue nil),
            :resolved => instance.send(prop)
          }
        end
        normalized_attrs[prop] = values
      end
      normalized_attrs
    end

default_for(attribute) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 227
    def default_for(attribute)
      method = "default_#{attribute}".to_sym
      if respond_to?(method)
        send(method)
      end
    end

inherit_from!(data) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 192
    def inherit_from!(data)
      if self.inherited_data
        self.inherited_data.inherit_from!(data)
      else
        self.inherited_data = data
      end
      self
    end

method_missing(meth, *args, &block) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 263
    def method_missing(meth, *args, &block)
      if inherited_data
        inherited_data.send(meth, *args, &block)
      else
        raise NoMethodError, meth.to_s
      end
    end

on_top!() click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 180
    def on_top!
      self.set_top_level(self)
    end

raw(attribute) click to toggle source

Reads the raw value that was set on this object. you generally should call raw_<attribute>() instead.

    # File lib/compass/configuration/inheritance.rb, line 249
    def raw(attribute)
      instance_variable_get("@#{attribute}")
    end

read(attribute) click to toggle source

Read a value that is either inherited or set on this instance, if we get to the bottom-most configuration instance, we ask for the default starting at the top level.

    # File lib/compass/configuration/inheritance.rb, line 255
    def read(attribute)
      if !(v = send("#{attribute}_without_default")).nil?
        v
      else
        top_level.default_for(attribute)
      end
    end

read_without_default(attribute) click to toggle source

Read an explicitly set value that is either inherited or set on this instance

    # File lib/compass/configuration/inheritance.rb, line 235
    def read_without_default(attribute)
      if set?(attribute)
        send("raw_#{attribute}")
      elsif inherited_data.nil?
        nil
      elsif inherited_data.respond_to?("#{attribute}_without_default")
        inherited_data.send("#{attribute}_without_default")
      elsif inherited_data.respond_to?(attribute)
        inherited_data.send(attribute)
      end
    end

reset_inheritance!() click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 201
    def reset_inheritance!
      self.inherited_data = nil
    end

respond_to?(meth) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 271
    def respond_to?(meth)
      if super
        true
      elsif inherited_data
        inherited_data.respond_to?(meth)
      else
        false
      end
    end

set?(attribute) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 218
    def set?(attribute)
      @set_attributes ||= {}
      @set_attributes[attribute]
    end

set_top_level(new_top) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 184
    def set_top_level(new_top)
      self.top_level = new_top
      if self.inherited_data.respond_to?(:set_top_level)
        self.inherited_data.set_top_level(new_top)
      end
    end

unset!(attribute) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 211
    def unset!(attribute)
      @set_attributes ||= {}
      send("#{attribute}=", nil)
      @set_attributes.delete(attribute)
      nil
    end

with_defaults(data) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 205
    def with_defaults(data)
      inherit_from!(data)
      yield
      reset_inheritance!
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.