Sha256: a30c5ae8ff70da2639bb94f7c5103ebe1deddafe04c792ef870feca360d43567
Contents?: true
Size: 387 Bytes
Versions: 7
Compression:
Stored size: 387 Bytes
Contents
class StyleStats::Css class Selector attr_accessor :name, :declarations def initialize(name, declarations = []) self.name = name self.declarations = declarations end def identifier_count trimmed_name = self.name.gsub(/\s?([\>\+\~])\s?/) { $1 } trimmed_name.gsub(/\s+/, ' ').split(/\s|\>|\+|\~|\:|[\w\]]\.|[\w\]]\#|\[/).count end end end
Version data entries
7 entries across 7 versions & 1 rubygems