Class: Sass::Value::Function
- Inherits:
-
Object
- Object
- Sass::Value::Function
show all
- Includes:
- Sass::Value
- Defined in:
- lib/sass/value/function.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
#[], #assert_boolean, #assert_calculation, #assert_color, #assert_map, #assert_mixin, #assert_number, #assert_string, #at, #bracketed?, #eql?, #sass_index_to_array_index, #separator, #to_a, #to_bool, #to_map, #to_nil
Constructor Details
#initialize(signature, &callback) ⇒ Function
Returns a new instance of Function.
13
14
15
16
|
# File 'lib/sass/value/function.rb', line 13
def initialize(signature, &callback)
@signature = signature.freeze
@callback = callback.freeze
end
|
Instance Attribute Details
#callback ⇒ Proc?
28
29
30
|
# File 'lib/sass/value/function.rb', line 28
def callback
@callback
end
|
#signature ⇒ ::String?
25
26
27
|
# File 'lib/sass/value/function.rb', line 25
def signature
@signature
end
|
Instance Method Details
#==(other) ⇒ ::Boolean
31
32
33
34
35
36
37
38
39
|
# File 'lib/sass/value/function.rb', line 31
def ==(other)
return false unless other.is_a?(Sass::Value::Function)
if defined?(@id)
other.compile_context == compile_context && other.id == id
else
other.signature == signature && other.callback == callback
end
end
|
#assert_function(_name = nil) ⇒ Function
47
48
49
|
# File 'lib/sass/value/function.rb', line 47
def assert_function(_name = nil)
self
end
|
#hash ⇒ Integer
42
43
44
|
# File 'lib/sass/value/function.rb', line 42
def hash
@hash ||= defined?(@id) ? [compile_context, id].hash : [signature, callback].hash
end
|