Class: Less::Node::Value
- Defined in:
- lib/less/engine/nodes/property.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #copy ⇒ Object
- #evaluate ⇒ Object
-
#initialize(ary, parent = nil) ⇒ Value
constructor
A new instance of Value.
- #to_css ⇒ Object
Methods inherited from Array
Constructor Details
#initialize(ary, parent = nil) ⇒ Value
Returns a new instance of Value.
112 113 114 115 116 117 118 119 |
# File 'lib/less/engine/nodes/property.rb', line 112 def initialize ary, parent = nil @parent = parent if ary.size == 1 && !ary.first.is_a?(Array) super [Expression.new([ary.first])] else super ary.map {|e| e.is_a?(Expression) ? e : Expression.new(e, self) } end end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
110 111 112 |
# File 'lib/less/engine/nodes/property.rb', line 110 def parent @parent end |
Instance Method Details
#copy ⇒ Object
130 131 132 |
# File 'lib/less/engine/nodes/property.rb', line 130 def copy first.copy end |
#evaluate ⇒ Object
126 127 128 |
# File 'lib/less/engine/nodes/property.rb', line 126 def evaluate map {|e| e.evaluate }.dissolve end |
#to_css ⇒ Object
134 135 136 |
# File 'lib/less/engine/nodes/property.rb', line 134 def to_css map {|e| e.to_css } * ', ' end |