Module: CSS
- Defined in:
- lib/css.rb
Class Method Summary collapse
-
.property(method, *args, &block) ⇒ Object
Write a css property declaration with the name of the called method.
-
.selector(selector, &block) ⇒ Object
Write a css selector declaration to $stdout.
-
.style(&block) ⇒ Object
Send a message to the module_eval method of CSS module.
Class Method Details
.property(method, *args, &block) ⇒ Object
Write a css property declaration with the name of the called method
17 18 19 |
# File 'lib/css.rb', line 17 def self.property method, *args, &block $stdout.write "#{method.to_s.gsub('_', '-')}:#{args[0]};" end |
.selector(selector, &block) ⇒ Object
Write a css selector declaration to $stdout
11 12 13 |
# File 'lib/css.rb', line 11 def self.selector selector, &block $stdout.write "#{selector}{"; yield; $stdout.write "}" end |
.style(&block) ⇒ Object
Send a message to the module_eval method of CSS module. It is just an Alias.
5 6 7 |
# File 'lib/css.rb', line 5 def self.style &block send :module_eval, &block end |