Class: Less::Node::Variable

Inherits:
Property show all
Defined in:
lib/less/engine/nodes/property.rb

Instance Attribute Summary

Attributes inherited from Property

#value

Attributes included from Entity

#parent

Instance Method Summary collapse

Methods inherited from Property

#<<, #empty?, #eval?, #evaluate

Methods included from Entity

#path, #root

Constructor Details

#initialize(key, value = nil) ⇒ Variable

Returns a new instance of Variable.



43
44
45
# File 'lib/less/engine/nodes/property.rb', line 43

def initialize key, value = nil      
  super key.delete('@'), value
end

Instance Method Details

#inspectObject



47
48
49
# File 'lib/less/engine/nodes/property.rb', line 47

def inspect
  "@#{super}"
end

#to_cssObject



59
60
61
# File 'lib/less/engine/nodes/property.rb', line 59

def to_css
  value.evaluate.to_css
end

#to_rubyObject



55
56
57
# File 'lib/less/engine/nodes/property.rb', line 55

def to_ruby
  value.evaluate.to_ruby
end

#to_sObject



51
52
53
# File 'lib/less/engine/nodes/property.rb', line 51

def to_s
  "@#{super}"
end