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
Returns a new instance of CSS.
6 7 8 |
# File 'lib/victor/css.rb', line 6 def initialize(attributes = nil) @attributes = attributes || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/victor/css.rb', line 4 def attributes @attributes end |
Instance Method Details
#render ⇒ Object
14 15 16 17 |
# File 'lib/victor/css.rb', line 14 def render return '' if attributes.empty? %Q{<style type="text/css">\n<![CDATA[\n#{self}\n]]>\n</style>\n} end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/victor/css.rb', line 10 def to_s convert_hash attributes end |