Sha256: 84179fd8dbe34e11bb52c03af184b07beedaa93eb71b07d3f2047abead32da99

Contents?: true

Size: 474 Bytes

Versions: 2

Compression:

Stored size: 474 Bytes

Contents

module BeautifulCss
  class Rule

    attr_accessor :selector, :prop, :value

    def initialize(selector, prop, value)
      @selector, @prop, @value = cleaner(selector), (prop || '').downcase, value
    end

    def cleaner sel
      sel.to_s.split(' ').map do |part|
        if part =~ /^[^\.^#]/
          part.downcase
        else
          part
        end
      end.join(' ')
    end

    def to_s
      @selector + "\n" + "{ #{prop}:#{value} }"
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
beautiful-css-0.1.01 lib/beautiful-css/rule.rb
beautiful-css-0.0.10 lib/beautiful-css/rule.rb