Class: Roadie::StyleBlock Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

Parameters:



12
13
14
15
# File 'lib/roadie/style_block.rb', line 12

def initialize(selector, properties)
  @selector = selector
  @properties = properties
end

Instance Attribute Details

#propertiesObject (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

#selectorObject (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_stringObject



24
# File 'lib/roadie/style_block.rb', line 24

def_delegator :selector, :to_s, :selector_string

#specificityObject



21
# File 'lib/roadie/style_block.rb', line 21

def_delegators :selector, :specificity, :inlinable?

#to_sObject

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