Sha256: a9bd7be818e93ec945c63399edf4fbbbc846c196f70fd3d2360ce47a4e593cf6

Contents?: true

Size: 1005 Bytes

Versions: 17

Compression:

Stored size: 1005 Bytes

Contents

module Sass::Script::Value
  # A SassScript object representing a null value.
  class Null < Base
    # The null value in SassScript.
    #
    # This is assigned before new is overridden below so that we use the default implementation.
    NULL = new(nil)

    # We override object creation so that users of the core API
    # will not need to know that null is a specific constant.
    #
    # @private
    # @return [Null] the {NULL} constant.
    def self.new
      NULL
    end

    # @return [Boolean] `false` (the Ruby boolean value)
    def to_bool
      false
    end

    # @return [Boolean] `true`
    def null?
      true
    end

    def neq(other)
      return other.neq(self) if other.is_a?(DeprecatedFalse)
      super
    end

    # @return [String] '' (An empty string)
    def to_s(opts = {})
      ''
    end

    def to_sass(opts = {})
      'null'
    end

    # Returns a string representing a null value.
    #
    # @return [String]
    def inspect
      'null'
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sass-3.3.14 lib/sass/script/value/null.rb
sass-3.3.13 lib/sass/script/value/null.rb
sass-3.3.12 lib/sass/script/value/null.rb
sass-3.3.11 lib/sass/script/value/null.rb
sass-3.3.10 lib/sass/script/value/null.rb
sass-3.3.9 lib/sass/script/value/null.rb
sass-3.3.8 lib/sass/script/value/null.rb
sass-3.3.7 lib/sass/script/value/null.rb
sass-3.3.6 lib/sass/script/value/null.rb
sass-3.3.5 lib/sass/script/value/null.rb
sass-3.3.4 lib/sass/script/value/null.rb
sass-3.3.3 lib/sass/script/value/null.rb
sass-3.3.2 lib/sass/script/value/null.rb
sass-3.3.1 lib/sass/script/value/null.rb
sass-3.3.0 lib/sass/script/value/null.rb
sass-3.3.0.rc.6 lib/sass/script/value/null.rb
sass-3.3.0.rc.5 lib/sass/script/value/null.rb