Class: MiniCSS::AST::AtRule
- Inherits:
-
Object
- Object
- MiniCSS::AST::AtRule
- Defined in:
- lib/minicss/ast/at_rule.rb
Instance Attribute Summary collapse
-
#child_rules ⇒ Object
Returns the value of attribute child_rules.
-
#name ⇒ Object
Returns the value of attribute name.
-
#prelude ⇒ Object
Returns the value of attribute prelude.
Instance Method Summary collapse
-
#initialize(rule) ⇒ AtRule
constructor
A new instance of AtRule.
Constructor Details
#initialize(rule) ⇒ AtRule
8 9 10 11 12 13 14 |
# File 'lib/minicss/ast/at_rule.rb', line 8 def initialize(rule) @name = rule.name.literal.gsub(/^@/, "") @prelude = rule.prelude.map { AST.convert(it) } @prelude.pop while @prelude.last == " " @prelude.shift while @prelude.first == " " @child_rules = rule.child_rules.map { AST.convert it } end |
Instance Attribute Details
#child_rules ⇒ Object
Returns the value of attribute child_rules.
6 7 8 |
# File 'lib/minicss/ast/at_rule.rb', line 6 def child_rules @child_rules end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/minicss/ast/at_rule.rb', line 6 def name @name end |
#prelude ⇒ Object
Returns the value of attribute prelude.
6 7 8 |
# File 'lib/minicss/ast/at_rule.rb', line 6 def prelude @prelude end |