Class: Victor::CSS
- Inherits:
-
Object
- Object
- Victor::CSS
- Defined in:
- lib/victor/css.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(attributes = nil) ⇒ CSS
constructor
A new instance of CSS.
- #render ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(attributes = nil) ⇒ CSS
5 6 7 |
# File 'lib/victor/css.rb', line 5 def initialize(attributes = nil) @attributes = attributes || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/victor/css.rb', line 3 def attributes @attributes end |
Instance Method Details
#render ⇒ Object
13 14 15 16 17 |
# File 'lib/victor/css.rb', line 13 def render return '' if attributes.empty? %[<style>\n#{self}\n</style>\n] end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/victor/css.rb', line 9 def to_s convert_hash attributes end |