Class: Sass::Script::ArgList

Inherits:
List show all
Defined in:
lib/sass/script/arg_list.rb

Overview

A SassScript object representing a variable argument list. This works just like a normal list, but can also contain keyword arguments.

The keyword arguments attached to this list are unused except when this is passed as a glob argument to a function or mixin.

Instance Attribute Summary collapse

Attributes inherited from List

#separator, #value

Attributes inherited from Literal

#value

Attributes inherited from Node

#line, #options

Instance Method Summary collapse

Methods inherited from List

#eq, #inspect, #to_s, #to_sass

Methods inherited from Literal

#==, #assert_int!, #comma, #div, #eq, #inspect, #minus, #neq, #null?, #options, #plus, #single_eq, #space, #to_a, #to_bool, #to_i, #to_s, #unary_div, #unary_minus, #unary_not, #unary_plus

Methods inherited from Node

#dasherize, #opts, #perform, #to_sass

Constructor Details

#initialize(value, keywords, separator) ⇒ ArgList

Creates a new argument list.

Parameters:



19
20
21
22
# File 'lib/sass/script/arg_list.rb', line 19

def initialize(value, keywords, separator)
  super(value, separator)
  @keywords = keywords
end

Instance Attribute Details

#keywords_accessedBoolean

Whether #keywords has been accessed. If so, we assume that all keywords were valid for the function that created this ArgList.

Returns:

  • (Boolean)


12
13
14
# File 'lib/sass/script/arg_list.rb', line 12

def keywords_accessed
  @keywords_accessed
end

Instance Method Details

#_perform(environment) (protected)

See Also:



48
49
50
# File 'lib/sass/script/arg_list.rb', line 48

def _perform(environment)
  self
end

#children

See Also:



33
34
35
# File 'lib/sass/script/arg_list.rb', line 33

def children
  super + @keywords.values
end

#deep_copy

See Also:



38
39
40
41
42
43
# File 'lib/sass/script/arg_list.rb', line 38

def deep_copy
  node = super
  node.instance_variable_set('@keywords',
    Sass::Util.map_hash(@keywords) {|k, v| [k, v.deep_copy]})
  node
end

#keywordsHash<String, Literal>

The keyword arguments attached to this list.

Returns:



27
28
29
30
# File 'lib/sass/script/arg_list.rb', line 27

def keywords
  @keywords_accessed = true
  @keywords
end