Parent

Methods

Class/Module Index [+]

Quicksearch

Sass::Script::Value::DeprecatedFalse

A SassScript object representing a `false` value that came from a call to `index()`. It will print deprecation warnings if it’s used with `==`.

Public Class Methods

new(environment) click to toggle source
# File lib/sass/script/value/deprecated_false.rb, line 5
def self.new(environment)
  obj = allocate
  obj.send(:initialize, environment)
  obj
end
new(environment) click to toggle source
# File lib/sass/script/value/deprecated_false.rb, line 11
def initialize(environment)
  @value = false
  @global_env = environment.global_env
  if (frame = environment.stack.frames.last)
    @filename = frame.filename
    @line = frame.line
  end
end

Public Instance Methods

eq(other) click to toggle source
# File lib/sass/script/value/deprecated_false.rb, line 20
def eq(other)
  if other.value == false && !warned?
    self.warned = true
    Sass::Util.sass_warn DEPRECATION WARNING: The return value of index() will change from "false" to"null" in future versions of Sass. For compatibility, avoid using "== false" onthe return value. For example, instead of "@if index(...) == false", just write"@if not index(...)". + @global_env.stack.to_s.gsub(/^/, '        ')
  end
  Bool.new(other.value == false)
end
neq(other) click to toggle source
# File lib/sass/script/value/deprecated_false.rb, line 33
def neq(other)
  if other.value.nil? && !warned?
    self.warned = true
    Sass::Util.sass_warn DEPRECATION WARNING: The return value of index() will change from "false" to"null" in future versions of Sass. For compatibility, avoid using "!= null" onthe return value. + @global_env.stack.to_s.gsub(/^/, '        ')
  end
  Bool.new(other.value != false)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.