Class: CSSPool::CSS::RuleSet

Inherits:
Node
  • Object
show all
Defined in:
lib/csspool/css/rule_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #accept, #children, #each, #hash, #to_css, #to_minified_css

Constructor Details

#initialize(selectors, declarations = [], media = []) ⇒ RuleSet

Returns a new instance of RuleSet.



8
9
10
11
12
13
14
# File 'lib/csspool/css/rule_set.rb', line 8

def initialize selectors, declarations = [], media = []
  @selectors    = selectors
  @declarations = declarations
  @media        = media

  selectors.each { |sel| sel.rule_set = self }
end

Instance Attribute Details

#declarationsObject

Returns the value of attribute declarations.



5
6
7
# File 'lib/csspool/css/rule_set.rb', line 5

def declarations
  @declarations
end

#mediaObject

Returns the value of attribute media.



6
7
8
# File 'lib/csspool/css/rule_set.rb', line 6

def media
  @media
end

#selectorsObject

Returns the value of attribute selectors.



4
5
6
# File 'lib/csspool/css/rule_set.rb', line 4

def selectors
  @selectors
end