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

Inherits:
Node
  • Object
show all
Defined in:
.ruby-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

#perform

Constructor Details

#initialize(value) ⇒ Literal

Creates a new literal value.

Parameters:

See Also:



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

def initialize(value)
  @value = value
end

Constructor Details

#initialize(value) ⇒ Literal

Creates a new literal value.

Parameters:

See Also:



16
17
18
# File '.ruby-sass/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 '.ruby-sass/lib/sass/script/tree/literal.rb', line 10

def value
  @value
end

Instance Method Details

#childrenObject

See Also:



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

def children; []; end

#deep_copyObject

See Also:



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

def deep_copy; dup; end

#force_division!Object



38
39
40
# File '.ruby-sass/lib/sass/script/tree/literal.rb', line 38

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

#inspectObject



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

def inspect
  value.inspect
end

#options=(options) ⇒ Object

See Also:



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

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

#to_sass(opts = {}) ⇒ Object

See Also:



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

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