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
17
18
|
# File 'lib/sass/value/function.rb', line 13
def initialize(signature, &callback)
raise Sass::ScriptError, 'no block given' unless signature.nil? || callback
@signature = signature.freeze
@callback = callback.freeze
end
|
Instance Attribute Details
#callback ⇒ Proc?
29
30
31
|
# File 'lib/sass/value/function.rb', line 29
def callback
@callback
end
|
#signature ⇒ ::String?
26
27
28
|
# File 'lib/sass/value/function.rb', line 26
def signature
@signature
end
|
Instance Method Details
#==(other) ⇒ ::Boolean
32
33
34
35
36
37
38
|
# File 'lib/sass/value/function.rb', line 32
def ==(other)
if id.nil?
other.equal?(self)
else
other.is_a?(Sass::Value::Function) && other.id == id
end
end
|
#assert_function(_name = nil) ⇒ Function
46
47
48
|
# File 'lib/sass/value/function.rb', line 46
def assert_function(_name = nil)
self
end
|
#hash ⇒ Integer
41
42
43
|
# File 'lib/sass/value/function.rb', line 41
def hash
@hash ||= id.nil? ? signature.hash : id.hash
end
|