class Roadie::StyleBlock

@api private A style block is the combination of a {Selector} and a list of {StyleProperty}.

Attributes

properties[R]
selector[R]

Public Class Methods

new(selector, properties) click to toggle source

@param [Selector] selector @param [Array<StyleProperty>] properties

# File lib/roadie/style_block.rb, line 12
def initialize(selector, properties)
  @selector = selector
  @properties = properties
end

Public Instance Methods

to_s() click to toggle source

String representation of the style block. This is valid CSS and can be used in the DOM.

# File lib/roadie/style_block.rb, line 28
def to_s
  "#{selector}{#{properties.map(&:to_s).join(';')}}"
end