### 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::Actions
- Compass::AppIntegration
- Compass::AppIntegration::Helpers
- Compass::AppIntegration::Rails
- Compass::AppIntegration::StandAlone
- Compass::AppIntegration::StandAlone::ConfigurationDefaults
- Compass::AppIntegration::StandAlone::Installer
- Compass::BrowserSupport
- Compass::Commands
- Compass::Commands::Base
- Compass::Commands::CleanProject
- Compass::Commands::CleanProjectOptionsParser
- Compass::Commands::CompileProjectOptionsParser
- Compass::Commands::ConfigurationOptionsParser
- Compass::Commands::CreateProject
- Compass::Commands::CreateProjectOptionsParser
- Compass::Commands::Default
- Compass::Commands::DefaultOptionsParser
- Compass::Commands::ExtensionCommand
- Compass::Commands::ExtensionOptionsParser
- Compass::Commands::ExtensionsOptionParser
- Compass::Commands::GenerateGridBackground
- Compass::Commands::GridBackgroundOptionsParser
- Compass::Commands::Help
- Compass::Commands::HelpOptionsParser
- Compass::Commands::Imports
- Compass::Commands::InstallerCommand
- Compass::Commands::Interactive
- Compass::Commands::InteractiveOptionsParser
- Compass::Commands::ListFrameworks
- Compass::Commands::MemoryDebugger
- Compass::Commands::PrintVersion
- Compass::Commands::ProjectBase
- Compass::Commands::ProjectStats
- Compass::Commands::Registry
- Compass::Commands::Sprite
- Compass::Commands::SpriteOptionsParser
- Compass::Commands::StampPattern
- Compass::Commands::StampPatternOptionsParser
- Compass::Commands::StatsOptionsParser
- Compass::Commands::StructureOptionsParser
- Compass::Commands::UnpackExtension
- Compass::Commands::UpdateProject
- Compass::Commands::ValidateProject
- Compass::Commands::ValidationOptionsParser
- Compass::Commands::VersionOptionsParser
- Compass::Commands::WatchProject
- Compass::Commands::WatchProjectOptionsParser
- Compass::Commands::WriteConfiguration
- Compass::Compiler
- Compass::Configuration
- Compass::Configuration::Adapters
- Compass::Configuration::Comments
- Compass::Configuration::Data
- Compass::Configuration::Defaults
- Compass::Configuration::FileData
- Compass::Configuration::Helpers
- Compass::Configuration::Inheritance
- Compass::Configuration::Inheritance::ClassMethods
- Compass::Configuration::Inheritance::ClassMethods::ArrayProxy
- Compass::Configuration::Inheritance::InstanceMethods
- Compass::Configuration::Paths
- Compass::Configuration::Serialization
- Compass::Error
- Compass::Exec
- Compass::Exec::CommandOptionParser
- Compass::Exec::GlobalOptionsParser
- Compass::Exec::Helpers
- Compass::Exec::ProjectOptionsParser
- Compass::Exec::SubCommandUI
- Compass::Exec::SwitchUI
- Compass::FilesystemConflict
- Compass::Frameworks
- Compass::Frameworks::Framework
- Compass::GridBuilder
- Compass::Installers
- Compass::Installers::BareInstaller
- Compass::Installers::Base
- Compass::Installers::Manifest
- Compass::Installers::Manifest::Entry
- Compass::Installers::ManifestInstaller
- Compass::Installers::TemplateContext
- Compass::Logger
- Compass::MissingDependency
- Compass::NullLogger
- Compass::PNG
- Compass::SassExtensions
- Compass::SassExtensions::Functions
- Compass::SassExtensions::Functions::Colors
- Compass::SassExtensions::Functions::Constants
- Compass::SassExtensions::Functions::CrossBrowserSupport
- Compass::SassExtensions::Functions::CrossBrowserSupport::CSS2FallbackValue
- Compass::SassExtensions::Functions::Display
- Compass::SassExtensions::Functions::Enumerate
- Compass::SassExtensions::Functions::Env
- Compass::SassExtensions::Functions::FontFiles
- Compass::SassExtensions::Functions::GradientSupport
- Compass::SassExtensions::Functions::GradientSupport::Assertions
- Compass::SassExtensions::Functions::GradientSupport::ColorStop
- Compass::SassExtensions::Functions::GradientSupport::Functions
- Compass::SassExtensions::Functions::GradientSupport::Gradient
- Compass::SassExtensions::Functions::GradientSupport::Gradient::ClassMethods
- Compass::SassExtensions::Functions::GradientSupport::LinearGradient
- Compass::SassExtensions::Functions::GradientSupport::RadialGradient
- Compass::SassExtensions::Functions::ImageSize
- Compass::SassExtensions::Functions::ImageSize::ImageProperties
- Compass::SassExtensions::Functions::ImageSize::JPEG
- Compass::SassExtensions::Functions::InlineImage
- Compass::SassExtensions::Functions::Lists
- Compass::SassExtensions::Functions::Math
- Compass::SassExtensions::Functions::Selectors
- Compass::SassExtensions::Functions::Sprites
- Compass::SassExtensions::Functions::Sprites::VariableReader
- Compass::SassExtensions::Functions::Urls
- Compass::SassExtensions::Functions::Urls::FontUrl
- Compass::SassExtensions::Functions::Urls::GeneratedImageUrl
- Compass::SassExtensions::Functions::Urls::ImageUrl
- Compass::SassExtensions::Functions::Urls::StylesheetUrl
- Compass::SassExtensions::Sprites
- Compass::SassExtensions::Sprites::ChunkyPngEngine
- Compass::SassExtensions::Sprites::Engine
- Compass::SassExtensions::Sprites::Image
- Compass::SassExtensions::Sprites::ImageMethods
- Compass::SassExtensions::Sprites::ImageRow
- Compass::SassExtensions::Sprites::LayoutMethods
- Compass::SassExtensions::Sprites::RowFitter
- Compass::SassExtensions::Sprites::SpriteMap
- Compass::SassExtensions::Sprites::SpriteMethods
- Compass::SpriteException
- Compass::SpriteImporter
- Compass::Sprites
- Compass::Sprites::Binding
- Compass::Stats
- Compass::Stats::CssFile
- Compass::Stats::SassFile
- Compass::Stats::StatsVisitor
- Compass::TestCase
- Compass::Util
- Compass::Version
- Sass
- Sass::Script
- Sass::Script::CrossBrowserFunctionCall
- Sass::Script::Funcall
- Sass::Script::Functions
- Sass::Script::Functions::EvaluationContext
- Sass::Script::HasSimpleCrossBrowserFunctionSupport
- Sass::Script::List
- Sass::Tree
- Sass::Tree::Node
- QuickCache

No matching classes.

# Compass::Configuration::Inheritance::InstanceMethods

### Public Instance Methods

any_attributes_set?() click to toggle source

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

chain() click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 278
    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 284
    def debug
      normalized_attrs = {}
      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 224
    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 189
    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 260
    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 177
    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 246
    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 252
    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 232
    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 198
    def reset_inheritance!
      self.inherited_data = nil
    end

respond_to?(meth) click to toggle source

    # File lib/compass/configuration/inheritance.rb, line 268
    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 215
    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 181
    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 208
    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 202
    def with_defaults(data)
      inherit_from!(data)
      yield
      reset_inheritance!
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.