Class: Fdlint::Parser::CSS::RuleSet
- Defined in:
- lib/fdlint/parser/css/struct.rb
Instance Attribute Summary collapse
-
#declarations ⇒ Object
readonly
Returns the value of attribute declarations.
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
Instance Method Summary collapse
-
#initialize(selector, declarations) ⇒ RuleSet
constructor
A new instance of RuleSet.
- #position ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(selector, declarations) ⇒ RuleSet
Returns a new instance of RuleSet.
60 61 62 |
# File 'lib/fdlint/parser/css/struct.rb', line 60 def initialize(selector, declarations) @selector, @declarations = selector, declarations end |
Instance Attribute Details
#declarations ⇒ Object (readonly)
Returns the value of attribute declarations.
58 59 60 |
# File 'lib/fdlint/parser/css/struct.rb', line 58 def declarations @declarations end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
58 59 60 |
# File 'lib/fdlint/parser/css/struct.rb', line 58 def selector @selector end |
Instance Method Details
#position ⇒ Object
72 73 74 |
# File 'lib/fdlint/parser/css/struct.rb', line 72 def position selector.position end |
#text ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/fdlint/parser/css/struct.rb', line 64 def text decs_text = declarations.collect { |dec| "#{' ' * 4}#{dec};" }.join("\n") "#{selector} {\n#{decs_text}\n}" end |