lib/less/tree.rb
#
# Find the nearest variable in the hierarchy
#
Find the nearest variable in the hierarchy
Find the nearest variable in the hierarchy
def nearest var, path
      values = []
      path.inject(self) do |branch, k|
        values << branch.var( var )
        branch[ k ]
      end
      values.compact.last
    end
def nearest var , path values = [ ] path . inject ( self ) do | branch , k | values << branch . var ( var ) branch [ k ] end values . compact . last end
Find the nearest variable in the hierarchy
Find the nearest variable in the hierarchy
var
path