mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Convert Sass::Tree::DirectiveNode docs to YARD.
This commit is contained in:
parent
eab40f8c29
commit
601059239d
1 changed files with 22 additions and 0 deletions
|
@ -1,12 +1,34 @@
|
||||||
module Sass::Tree
|
module Sass::Tree
|
||||||
|
# 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 {DirectiveNode}s.
|
||||||
|
#
|
||||||
|
# `@import` is a bit of a weird case;
|
||||||
|
# if it's importing a Sass file,
|
||||||
|
# it becomes a {FileNode},
|
||||||
|
# but if it's importing a plain CSS file,
|
||||||
|
# it becomes a {DirectiveNode}.
|
||||||
|
#
|
||||||
|
# @see Sass::Tree
|
||||||
class DirectiveNode < Node
|
class DirectiveNode < Node
|
||||||
|
# The text of the directive, `@` and all.
|
||||||
|
#
|
||||||
|
# @return [String]
|
||||||
attr_accessor :value
|
attr_accessor :value
|
||||||
|
|
||||||
|
# @param value [String] See \{#value}
|
||||||
|
# @param options [Hash<Symbol, Object>] An options hash;
|
||||||
|
# see [the Sass options documentation](../../Sass.html#sass_options)
|
||||||
def initialize(value, options)
|
def initialize(value, options)
|
||||||
@value = value
|
@value = value
|
||||||
super(options)
|
super(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Computes the CSS for the directive.
|
||||||
|
#
|
||||||
|
# @param tabs [Fixnum] The level of indentation for the CSS
|
||||||
|
# @return [String] The resulting CSS
|
||||||
def to_s(tabs)
|
def to_s(tabs)
|
||||||
if children.empty?
|
if children.empty?
|
||||||
value + ";"
|
value + ";"
|
||||||
|
|
Loading…
Add table
Reference in a new issue