Class: Sass::Stack::Frame

Inherits:
Object
  • Object
show all
Defined in:
/home/nweiz/code/sass-site/.sass/lib/sass/stack.rb

Overview

A single stack frame.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Frame) initialize(filename, line, type, name = nil)

Returns a new instance of Frame



35
36
37
38
39
40
# File '/home/nweiz/code/sass-site/.sass/lib/sass/stack.rb', line 35

def initialize(filename, line, type, name = nil)
  @filename = filename
  @line = line
  @type = type
  @name = name
end

Instance Attribute Details

- (String) filename (readonly)

The filename of the file in which this stack frame was created.

Returns:

  • (String)


11
12
13
# File '/home/nweiz/code/sass-site/.sass/lib/sass/stack.rb', line 11

def filename
  @filename
end

- (String) line (readonly)

The line number on which this stack frame was created.

Returns:

  • (String)


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

def line
  @line
end

- (String?) name (readonly)

The name of the stack frame. For mixin frames, this is the mixin name; otherwise, it's nil.

Returns:

  • (String?)


33
34
35
# File '/home/nweiz/code/sass-site/.sass/lib/sass/stack.rb', line 33

def name
  @name
end

- (Symbol?) type (readonly)

The type of this stack frame. This can be :import, :mixin, or :base.

:base indicates that this is the bottom-most frame, meaning that it represents a single line of code rather than a nested context. The stack will only ever have one base frame, and it will always be the most deeply-nested frame.

Returns:

  • (Symbol?)


27
28
29
# File '/home/nweiz/code/sass-site/.sass/lib/sass/stack.rb', line 27

def type
  @type
end

Instance Method Details

- (Boolean) is_base?

Whether this is the base frame.

Returns:

  • (Boolean)


59
60
61
# File '/home/nweiz/code/sass-site/.sass/lib/sass/stack.rb', line 59

def is_base?
  type == :base
end

- (Boolean) is_import?

Whether this frame represents an import.

Returns:

  • (Boolean)


45
46
47
# File '/home/nweiz/code/sass-site/.sass/lib/sass/stack.rb', line 45

def is_import?
  type == :import
end

- (Boolean) is_mixin?

Whether this frame represents a mixin.

Returns:

  • (Boolean)


52
53
54
# File '/home/nweiz/code/sass-site/.sass/lib/sass/stack.rb', line 52

def is_mixin?
  type == :mixin
end