Class: Roadie::StyleBlock Private
- Inherits:
-
Object
- Object
- Roadie::StyleBlock
- Extended by:
- Forwardable
- Defined in:
- lib/roadie/style_block.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A style block is the combination of a Selector and a list of StyleProperty.
Instance Attribute Summary collapse
- #properties ⇒ Object readonly private
- #selector ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(selector, properties) ⇒ StyleBlock
constructor
private
A new instance of StyleBlock.
- #inlinable? ⇒ Object
- #selector_string ⇒ Object
- #specificity ⇒ Object
-
#to_s ⇒ Object
private
String representation of the style block.
Constructor Details
#initialize(selector, properties) ⇒ StyleBlock
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of StyleBlock.
12 13 14 15 |
# File 'lib/roadie/style_block.rb', line 12 def initialize(selector, properties) @selector = selector @properties = properties end |
Instance Attribute Details
#properties ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/roadie/style_block.rb', line 8 def properties @properties end |
#selector ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/roadie/style_block.rb', line 8 def selector @selector end |
Instance Method Details
#inlinable? ⇒ Object
21 |
# File 'lib/roadie/style_block.rb', line 21 def_delegators :selector, :specificity, :inlinable? |
#selector_string ⇒ Object
24 |
# File 'lib/roadie/style_block.rb', line 24 def_delegator :selector, :to_s, :selector_string |
#specificity ⇒ Object
21 |
# File 'lib/roadie/style_block.rb', line 21 def_delegators :selector, :specificity, :inlinable? |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
String representation of the style block. This is valid CSS and can be used in the DOM.
28 29 30 |
# File 'lib/roadie/style_block.rb', line 28 def to_s "#{selector}{#{properties.map(&:to_s).join(';')}}" end |