Class: Sass::Value::ArgumentList

Inherits:
List
  • Object
show all
Defined in:
lib/sass/value/argument_list.rb

Overview

Sass’s argument list type.

An argument list comes from a rest argument. It’s distinct from a normal List in that it may contain a keyword map as well as the positional arguments.

Instance Attribute Summary

Attributes inherited from List

#contents, #separator

Instance Method Summary collapse

Methods inherited from List

#==, #assert_map, #at, #bracketed?, #hash, #to_map

Methods included from Sass::Value

#[], #assert_boolean, #assert_calculation, #assert_color, #assert_function, #assert_map, #assert_number, #assert_string, #at, #bracketed?, #eql?, #sass_index_to_array_index, #separator, #to_a, #to_bool, #to_map, #to_nil

Constructor Details

#initialize(contents = [], keywords = {}, separator = ',') ⇒ ArgumentList

Returns a new instance of ArgumentList.

Parameters:

  • contents (Array<Value>) (defaults to: [])
  • keywords (Hash<::String, Value>) (defaults to: {})
  • separator (::String) (defaults to: ',')


15
16
17
18
19
20
21
# File 'lib/sass/value/argument_list.rb', line 15

def initialize(contents = [], keywords = {}, separator = ',')
  super(contents, separator: separator)

  @id = 0
  @keywords_accessed = false
  @keywords = keywords.transform_keys(&:to_s).freeze
end

Instance Method Details

#keywordsHash<::String, Value>

Returns:

  • (Hash<::String, Value>)


24
25
26
27
# File 'lib/sass/value/argument_list.rb', line 24

def keywords
  @keywords_accessed = true
  @keywords
end