class CSS
Public Instance Methods
property(method, *args, &block)
click to toggle source
Write a css property declaration with the name of the called method @param method [Symbol] the called method name as a symbol
# File lib/css.rb, line 17 def property method, *args, &block $stdout.write "#{method.to_s.gsub('_', '-')}:#{args[0]};" end
selector(selector) { || ... }
click to toggle source
Write a css selector declaration to $stdout @param selector [String] the selector name or string
# File lib/css.rb, line 11 def selector selector, &block $stdout.write "#{selector}{"; yield; $stdout.write "}" end
Private Instance Methods
method_missing(name, *args, &block)
click to toggle source
# File lib/css.rb, line 23 def method_missing name, *args, &block send(:selector, *args, &block) if block send(:property, name, *args, &block) if args[0] and !block end