Class: Less::Node::String
- 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) ⇒ String
constructor
Strip quotes if necessary, and save them in @quotes.
- #to_css ⇒ Object
Methods included from Literal
Methods included from Entity
Methods inherited from String
#blank?, #column_of, #indent, #line_of, #tabto, #treetop_camelize
Constructor Details
#initialize(str) ⇒ String
Strip quotes if necessary, and save them in @quotes
88 89 90 91 92 93 94 95 |
# File 'lib/less/engine/nodes/literal.rb', line 88 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.
85 86 87 |
# File 'lib/less/engine/nodes/literal.rb', line 85 def content @content end |
#quotes ⇒ Object (readonly)
Returns the value of attribute quotes.
85 86 87 |
# File 'lib/less/engine/nodes/literal.rb', line 85 def quotes @quotes end |
Instance Method Details
#to_css ⇒ Object
97 98 99 |
# File 'lib/less/engine/nodes/literal.rb', line 97 def to_css "#@quotes#{@content}#@quotes" end |