Class: Css2Less::Converter
- Inherits:
-
Object
- Object
- Css2Less::Converter
- Defined in:
- lib/css2less.rb
Instance Method Summary collapse
- #get_less ⇒ Object
-
#initialize(css = nil) ⇒ Converter
constructor
A new instance of Converter.
- #process_less ⇒ Object
- #set_css(css) ⇒ Object
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_less ⇒ Object
45 46 47 |
# File 'lib/css2less.rb', line 45 def get_less return @less end |
#process_less ⇒ Object
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 |