Sha256: d0f0eef05ffff917890bce00aa34d5cab3bf686127a5f4a74e043ba1e693a827
Contents?: true
Size: 700 Bytes
Versions: 17
Compression:
Stored size: 700 Bytes
Contents
module Roadie class StyleDeclaration include Comparable attr_reader :property, :value, :important, :specificity def initialize(property, value, important, specificity) @property = property @value = value @important = important @specificity = specificity end def important? @important end def <=>(other) if important == other.important specificity <=> other.specificity else important ? 1 : -1 end end def to_s [property, value].join(':') end def inspect extra = [important ? '!important' : nil, specificity].compact "#{to_s} (#{extra.join(' , ')})" end end end
Version data entries
17 entries across 17 versions & 1 rubygems