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, #one?

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

#parentObject

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

#copyObject



130
131
132
# File 'lib/less/engine/nodes/property.rb', line 130

def copy
  first.copy
end

#evaluateObject



126
127
128
# File 'lib/less/engine/nodes/property.rb', line 126

def evaluate
  map {|e| e.evaluate }.dissolve
end

#to_cssObject



134
135
136
# File 'lib/less/engine/nodes/property.rb', line 134

def to_css
  map {|e| e.to_css } * ', '
end