Class: Fdlint::Parser::CSS::Directive
- Defined in:
- lib/fdlint/parser/css/struct.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
Instance Method Summary collapse
-
#initialize(keyword, expression, block = nil) ⇒ Directive
constructor
A new instance of Directive.
- #position ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(keyword, expression, block = nil) ⇒ Directive
Returns a new instance of Directive.
35 36 37 |
# File 'lib/fdlint/parser/css/struct.rb', line 35 def initialize(keyword, expression, block = nil) @keyword, @expression, @block = keyword, expression, block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
33 34 35 |
# File 'lib/fdlint/parser/css/struct.rb', line 33 def block @block end |
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
33 34 35 |
# File 'lib/fdlint/parser/css/struct.rb', line 33 def expression @expression end |
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
33 34 35 |
# File 'lib/fdlint/parser/css/struct.rb', line 33 def keyword @keyword end |
Instance Method Details
#position ⇒ Object
52 53 54 |
# File 'lib/fdlint/parser/css/struct.rb', line 52 def position keyword.position end |
#text ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fdlint/parser/css/struct.rb', line 39 def text t = "@#{keyword}" if expression t += "#{expression}" end if block t += "{\n#{block}\n}\n" else t += ';' end t end |