Class: Css2Less::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/css2less.rb

Instance Method Summary collapse

Constructor Details

#initialize(css = nil) ⇒ Converter

Returns a new instance of Converter.



24
25
26
27
28
29
30
# File 'lib/css2less.rb', line 24

def initialize(css=nil)
  if not css.nil?
    @css = css
  end
  @tree = {}
  @less = ''
end

Instance Method Details

#get_lessObject



45
46
47
# File 'lib/css2less.rb', line 45

def get_less
  return @less
end

#process_lessObject



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/css2less.rb', line 32

def process_less
  cleanup
  if @css.nil?
  return false
  end
  if @css.empty?
  return false
  end
  generate_tree
  render_less
  return true
end

#set_css(css) ⇒ Object



49
50
51
# File 'lib/css2less.rb', line 49

def set_css(css)
  @css = css
end