Sha256: d39691ac0ee050ee2aa90c330d76ea7e4f86b84973a0dfd79147930e04b41d1f

Contents?: true

Size: 681 Bytes

Versions: 1

Compression:

Stored size: 681 Bytes

Contents

module CssParserMaster
  class Declaration
    attr_accessor :property, :value, :important, :order
    
    def initialize(property, value, important = false, order = 0)
      # puts "init new declaration: #{property}"
      @property = property
      @value = value
      @important = important
      @order = order            
    end

    def [] index
      case index
      when :value
        value
      when :order
        order
      when :is_important
        important
      when :property
        property
      end
    end        
    
    def to_text(importance = nil)
      "#{property}: #{value}#{ ' !important' if important || importance};"
    end
      
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
css_parser_master-1.2.4 lib/css_parser_master/declaration.rb