Class: Sass::Supports::Interpolation
- Defined in:
- lib/sass/supports.rb
Overview
An interpolation condition (e.g. #{$var}
).
Instance Attribute Summary collapse
-
#resolved_value ⇒ String
The value of the expression after it's been resolved.
-
#value
The SassScript expression in the interpolation.
Instance Method Summary collapse
- #deep_copy
-
#initialize(value) ⇒ Interpolation
constructor
A new instance of Interpolation.
- #options=(options)
- #perform(env)
- #to_css
- #to_src(options)
Constructor Details
#initialize(value) ⇒ Interpolation
Returns a new instance of Interpolation.
202 203 204 |
# File 'lib/sass/supports.rb', line 202
def initialize(value)
@value = value
end
|
Instance Attribute Details
#resolved_value ⇒ String
The value of the expression after it's been resolved. Only set once Tree::Visitors::Perform has been run.
200 201 202 |
# File 'lib/sass/supports.rb', line 200
def resolved_value
@resolved_value
end
|
#value
The SassScript expression in the interpolation.
194 195 196 |
# File 'lib/sass/supports.rb', line 194
def value
@value
end
|
Instance Method Details
#deep_copy
219 220 221 222 223 |
# File 'lib/sass/supports.rb', line 219
def deep_copy
copy = dup
copy.value = @value.deep_copy
copy
end
|
#options=(options)
225 226 227 |
# File 'lib/sass/supports.rb', line 225
def options=(options)
@value.options = options
end
|
#perform(env)
206 207 208 209 |
# File 'lib/sass/supports.rb', line 206
def perform(env)
val = value.perform(env)
@resolved_value = val.is_a?(Sass::Script::String) ? val.value : val.to_s
end
|
#to_css
211 212 213 |
# File 'lib/sass/supports.rb', line 211
def to_css
@resolved_value
end
|
#to_src(options)
215 216 217 |
# File 'lib/sass/supports.rb', line 215
def to_src(options)
"\#{#{@value.to_sass(options)}}"
end
|