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

Inherits:
Node
  • Object
show all
Defined in:
/home/nweiz/code/sass-site/.sass/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

- (Literal) initialize(value)

Creates a new literal value.

Parameters:

See Also:



16
17
18
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 16

def initialize(value)
  @value = value
end

Instance Attribute Details

- (Sass::Script::Value::Base) value (readonly)

The wrapped value.



10
11
12
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 10

def value
  @value
end

Instance Method Details

- _perform(environment) (protected)



44
45
46
47
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 44

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

- children

See Also:



21
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 21

def children; []; end

- deep_copy

See Also:



27
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 27

def deep_copy; dup; end

- force_division!



38
39
40
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 38

def force_division!
  value.original = nil if value.is_a?(Sass::Script::Value::Number)
end

- inspect



34
35
36
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 34

def inspect
  value.inspect
end

- options=(options)

See Also:



30
31
32
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 30

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

- to_sass(opts = {})

See Also:



24
# File '/home/nweiz/code/sass-site/.sass/lib/sass/script/tree/literal.rb', line 24

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