Class: Sass::Tree::DirectiveNode
- Inherits:
-
Node
- Object
- Node
- Sass::Tree::DirectiveNode
- Defined in:
- /var/www/sass-pages/.sass/lib/sass/tree/directive_node.rb
Overview
A static node representing an unproccessed Sass @-directive. Directives known to Sass, like @for and @debug, are handled by their own nodes; only CSS directives like @media and @font-face become DirectiveNodes.
@import and @charset are special cases; they become ImportNodes and CharsetNodes, respectively.
Direct Known Subclasses
Instance Attribute Summary
-
- (String) value
The text of the directive,
@and all.
Instance Method Summary
- - (DirectiveNode) initialize(value) constructor A new instance of DirectiveNode.
-
- (String) name
The name of the directive, including
@.
Methods inherited from Node
#<<, #==, #balance, #deep_copy, #do_extend, #each, #inspect, #invisible?, #style, #to_s, #to_sass, #to_scss
Constructor Details
- (DirectiveNode) initialize(value)
A new instance of DirectiveNode
18 19 20 21 |
# File '/var/www/sass-pages/.sass/lib/sass/tree/directive_node.rb', line 18
def initialize(value)
@value = value
super()
end
|
Instance Attribute Details
- (String) value
The text of the directive, @ and all.
15 16 17 |
# File '/var/www/sass-pages/.sass/lib/sass/tree/directive_node.rb', line 15
def value
@value
end
|
Instance Method Details
- (String) name
The name of the directive, including @.
24 25 26 |
# File '/var/www/sass-pages/.sass/lib/sass/tree/directive_node.rb', line 24
def name
value.gsub(/ .*$/, '')
end
|