Class: Sass::Value::ArgumentList

Inherits:
Value::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 Method Summary collapse

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