Class: Less::Node::Value
- Inherits:
-
Array
show all
- Defined in:
- lib/less/engine/nodes/property.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Array
#dissolve, #mean, #one?, #sum
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
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
130
131
132
|
# File 'lib/less/engine/nodes/property.rb', line 130
def copy
first.copy
end
|
126
127
128
|
# File 'lib/less/engine/nodes/property.rb', line 126
def evaluate
map {|e| e.evaluate }.dissolve
end
|
134
135
136
|
# File 'lib/less/engine/nodes/property.rb', line 134
def to_css
map {|e| e.to_css } * ', '
end
|