Class | Sass::Script::Literal |
In: |
lib/sass/script/literal.rb
|
Parent: | Node |
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.
value | [R] |
Returns the Ruby value of the literal. The type of this value varies based
on the subclass.
@return [Object] |
The SassScript `,` operation (e.g. `$a, $b`, `"foo", "bar"`).
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing both literals
separated by `", "`
The SassScript default operation (e.g. `$a $b`, `"foo" "bar"`).
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing both literals
separated by a space
The SassScript `/` operation.
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing both literals
separated by `"/"`
The SassScript `==` operation. **Note that this returns a {Sass::Script::Bool} object, not a Ruby boolean**.
@param other [Literal] The right-hand side of the operator @return [Bool] True if this literal is the same as the other,
false otherwise
The SassScript `-` operation.
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing both literals
separated by `"-"`
The SassScript `!=` operation. **Note that this returns a {Sass::Script::Bool} object, not a Ruby boolean**.
@param other [Literal] The right-hand side of the operator @return [Bool] False if this literal 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 literal was created outside of the parser and \{#to\_s} was called on it
The SassScript `+` operation.
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing both literals
without any separation
The SassScript `=` operation (used for proprietary MS syntax like `alpha(opacity=20)`).
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing both literals
separated by `"="`
@return [Fixnum] The integer value of this literal @raise [Sass::SyntaxError] if this literal isn‘t an integer
The SassScript unary `/` operation (e.g. `/$a`).
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing the literal
preceded by `"/"`
The SassScript unary `-` operation (e.g. `-$a`).
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing the literal
preceded by `"-"`
The SassScript `==` operation. **Note that this returns a {Sass::Script::Bool} object, not a Ruby boolean**.
@param other [Literal] The right-hand side of the operator @return [Bool] True if this literal is the same as the other,
false otherwise
The SassScript unary `+` operation (e.g. `+$a`).
@param other [Literal] The right-hand side of the operator @return [Script::String] A string containing the literal
preceded by `"+"`
Evaluates the literal.
@param environment [Sass::Environment] The environment in which to evaluate the SassScript @return [Literal] This literal