Sha256: ad67141bc888f6fba52188d7db4621b0d8b74ab4380379533da5cedf379f8ce1
Contents?: true
Size: 531 Bytes
Versions: 14
Compression:
Stored size: 531 Bytes
Contents
module Glimmer module CSS class Rule attr_reader :selector, :properties def initialize(selector) @selector = selector @properties = {} end def add_property(keyword, *args) keyword = keyword.to_s.downcase.gsub('_', '-') @properties[keyword] = args.first end def to_css css = "#{@selector}{" css << @properties.map { |name, value| "#{name}:#{value}" }.join(';') css << "}" end alias to_s to_css end end end
Version data entries
14 entries across 14 versions & 2 rubygems