Class: CSSPool::CSS::RuleSet

Inherits:
Struct
  • Object
show all
Includes:
Visitable
Defined in:
lib/csspool/css/rule_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Visitable

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

Constructor Details

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

Returns a new instance of RuleSet.



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

def initialize selectors, declarations = [], media = []
  selectors.each { |sel| sel.rule_set = self }
  super
end

Instance Attribute Details

#declarationsObject

Returns the value of attribute declarations

Returns:

  • (Object)

    the current value of declarations



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

def declarations
  @declarations
end

#mediaObject

Returns the value of attribute media

Returns:

  • (Object)

    the current value of media



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

def media
  @media
end

#selectorsObject

Returns the value of attribute selectors

Returns:

  • (Object)

    the current value of selectors



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

def selectors
  @selectors
end