Class: Sass::Script::Tree::Literal

Inherits:
Node
  • Object
show all
Defined in:
lib/sass/script/tree/literal.rb

Overview

The parse tree node for a literal scalar value. This wraps an instance of Value::Base.

List literals should use ListLiteral instead.

Instance Attribute Summary collapse

Attributes inherited from Node

#filename, #line, #options, #source_range

Instance Method Summary collapse

Methods inherited from Node

#dasherize, #opts, #perform

Constructor Details

#initialize(value) ⇒ Literal

Creates a new literal value.

Parameters:

See Also:


16
17
18
# File 'lib/sass/script/tree/literal.rb', line 16

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueSass::Script::Value::Base (readonly)

The wrapped value.


10
11
12
# File 'lib/sass/script/tree/literal.rb', line 10

def value
  @value
end

Instance Method Details

#_perform(environment) (protected)


40
41
42
43
# File 'lib/sass/script/tree/literal.rb', line 40

def _perform(environment)
  value.source_range = source_range
  value
end

#children

See Also:


21
# File 'lib/sass/script/tree/literal.rb', line 21

def children; []; end

#deep_copy

See Also:


27
# File 'lib/sass/script/tree/literal.rb', line 27

def deep_copy; dup; end

#inspect


34
35
36
# File 'lib/sass/script/tree/literal.rb', line 34

def inspect
  value.inspect
end

#options=(options)

See Also:


30
31
32
# File 'lib/sass/script/tree/literal.rb', line 30

def options=(options)
  value.options = options
end

#to_sass(opts = {})

See Also:


24
# File 'lib/sass/script/tree/literal.rb', line 24

def to_sass(opts = {}); value.to_sass(opts); end