Class: Less::Node::Quoted
- Inherits:
-
String
- Object
- String
- Less::Node::Quoted
- Includes:
- Literal
- Defined in:
- lib/less/engine/nodes/literal.rb
Overview
“hello world”
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#quotes ⇒ Object
readonly
Returns the value of attribute quotes.
Attributes included from Entity
Instance Method Summary collapse
-
#initialize(str) ⇒ Quoted
constructor
Strip quotes if necessary, and save them in @quotes.
- #to_css ⇒ Object
Methods included from Literal
Methods included from Entity
Constructor Details
#initialize(str) ⇒ Quoted
Strip quotes if necessary, and save them in @quotes
124 125 126 127 128 129 130 131 |
# File 'lib/less/engine/nodes/literal.rb', line 124 def initialize str @quotes, @content = unless str.nil? or str.empty? str.match(/('|")(.*?)(\1)/).captures rescue [nil, str] else [nil, ""] end super @content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
121 122 123 |
# File 'lib/less/engine/nodes/literal.rb', line 121 def content @content end |
#quotes ⇒ Object (readonly)
Returns the value of attribute quotes.
121 122 123 |
# File 'lib/less/engine/nodes/literal.rb', line 121 def quotes @quotes end |
Instance Method Details
#to_css ⇒ Object
133 134 135 |
# File 'lib/less/engine/nodes/literal.rb', line 133 def to_css "#@quotes#{@content}#@quotes" end |