Class: Less2Sass::Less::Tree::AnonymousNode
- Defined in:
- lib/less2sass/less/tree/anonymous_node.rb
Overview
Represents a CSS literal in Less.
Its Sass equivalent is Sass::Script::Value::Base wrapped in Sass::Script::Tree::Literal.
Instance Attribute Summary collapse
-
#currentFileInfo ⇒ Object
Returns the value of attribute currentFileInfo.
-
#index ⇒ Object
Returns the value of attribute index.
-
#mapLines ⇒ Object
Returns the value of attribute mapLines.
-
#rulesetLike ⇒ Object
Returns the value of attribute rulesetLike.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
#children, #has_children, #has_parent, #line, #parent, #ref_vars
Instance Method Summary collapse
-
#to_sass ⇒ ::Sass::Script::Tree::Literal
Converts to a Sass::Script::Tree::Literal that encapsulates a Sass::Script::Value::Base.
Methods inherited from Node
#<<, #==, #contains_variables?, #creates_context?, #each, #get_referenced_variable_names, #initialize, #transform
Constructor Details
This class inherits a constructor from Less2Sass::Less::Tree::Node
Instance Attribute Details
#currentFileInfo ⇒ Object
Returns the value of attribute currentFileInfo.
12 13 14 |
# File 'lib/less2sass/less/tree/anonymous_node.rb', line 12 def currentFileInfo @currentFileInfo end |
#index ⇒ Object
Returns the value of attribute index.
10 11 12 |
# File 'lib/less2sass/less/tree/anonymous_node.rb', line 10 def index @index end |
#mapLines ⇒ Object
Returns the value of attribute mapLines.
11 12 13 |
# File 'lib/less2sass/less/tree/anonymous_node.rb', line 11 def mapLines @mapLines end |
#rulesetLike ⇒ Object
Returns the value of attribute rulesetLike.
13 14 15 |
# File 'lib/less2sass/less/tree/anonymous_node.rb', line 13 def rulesetLike @rulesetLike end |
#value ⇒ Object
Returns the value of attribute value.
9 10 11 |
# File 'lib/less2sass/less/tree/anonymous_node.rb', line 9 def value @value end |
Instance Method Details
#to_sass ⇒ ::Sass::Script::Tree::Literal
Never seen a different equivalent than String or a Number but can’t be sure.
Converts to a Sass::Script::Tree::Literal that encapsulates a Sass::Script::Value::Base.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/less2sass/less/tree/anonymous_node.rb', line 24 def to_sass subnode ||= begin if @value.is_a?(String) # Always an :identifier - the default value of the 2nd param ::Sass::Script::Value::String.new(@value) elsif @value.is_a?(Numeric) # Anonymous nodes do not have a numerator nor a denominator ::Sass::Script::Value::Number.new(@value) else raise FeatureConversionError, self end end return subnode if subnode.is_a?(::Sass::Script::Tree::Literal) node(::Sass::Script::Tree::Literal.new(subnode), line) end |