Class | Sass::Script::Value::Base |
In: |
lib/sass/script/value/base.rb
|
Parent: | Object |
The abstract superclass for SassScript objects.
Many of these methods, especially the ones that correspond to SassScript operations, are designed to be overridden by subclasses which may change the semantics somewhat. The operations listed here are just the defaults.
options | [W] | Sets the options hash for this node, as well as for all child nodes. See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}. |
source_range | [RW] |
The source range in the document on which this node appeared.
@return [Sass::Source::Range] |
value | [R] |
Returns the Ruby value of the value. The type of this value varies based on
the subclass.
@return [Object] |
Compares this object with another.
@param other [Object] The object to compare with @return [Boolean] Whether or not this value is equivalent to `other`
The SassScript `/` operation.
@param other [Value] The right-hand side of the operator @return [Script::Value::String] A string containing both values
separated by `"/"`
The SassScript `==` operation. **Note that this returns a {Sass::Script::Value::Bool} object, not a Ruby boolean**.
@param other [Value] The right-hand side of the operator @return [Sass::Script::Value::Bool] True if this value is the same as the other,
false otherwise
The SassScript `-` operation.
@param other [Value] The right-hand side of the operator @return [Script::Value::String] A string containing both values
separated by `"-"`
The SassScript `!=` operation. **Note that this returns a {Sass::Script::Value::Bool} object, not a Ruby boolean**.
@param other [Value] The right-hand side of the operator @return [Sass::Script::Value::Bool] False if this value is the same as the other,
true otherwise
Returns the options hash for this node.
@return [{Symbol => Object}] @raise [Sass::SyntaxError] if the options hash hasn‘t been set.
This should only happen when the value was created outside of the parser and \{#to\_s} was called on it
The SassScript `+` operation.
@param other [Value] The right-hand side of the operator @return [Script::Value::String] A string containing both values
without any separation
Returns the separator for this value. For non-list-like values or the empty list, this will be `nil`. For lists or maps, it will be `:space` or `:comma`.
@return [Symbol]
The SassScript `=` operation (used for proprietary MS syntax like `alpha(opacity=20)`).
@param other [Value] The right-hand side of the operator @return [Script::Value::String] A string containing both values
separated by `"="`
Returns the value of this value as a list. Single values are considered the same as single-element lists.
@return [Array<Value>] This value as a list
@return [Integer] The integer value of this value @raise [Sass::SyntaxError] if this value isn‘t an integer
The SassScript unary `/` operation (e.g. `/$a`).
@param other [Value] The right-hand side of the operator @return [Script::Value::String] A string containing the value
preceded by `"/"`
The SassScript unary `-` operation (e.g. `-$a`).
@param other [Value] The right-hand side of the operator @return [Script::Value::String] A string containing the value
preceded by `"-"`
The SassScript `==` operation. **Note that this returns a {Sass::Script::Value::Bool} object, not a Ruby boolean**.
@param other [Value] The right-hand side of the operator @return [Sass::Script::Value::Bool] True if this value is the same as the other,
false otherwise
The SassScript unary `+` operation (e.g. `+$a`).
@param other [Value] The right-hand side of the operator @return [Script::Value::String] A string containing the value
preceded by `"+"`
Evaluates the value.
@param environment [Sass::Environment] The environment in which to evaluate the SassScript @return [Value] This value