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?
27
28
29
|
# File 'lib/sass/value/function.rb', line 27
def callback
@callback
end
|
#signature ⇒ ::String?
24
25
26
|
# File 'lib/sass/value/function.rb', line 24
def signature
@signature
end
|
Instance Method Details
#==(other) ⇒ ::Boolean
30
31
32
33
34
35
36
|
# File 'lib/sass/value/function.rb', line 30
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
44
45
46
|
# File 'lib/sass/value/function.rb', line 44
def assert_function(_name = nil)
self
end
|
#hash ⇒ Integer
39
40
41
|
# File 'lib/sass/value/function.rb', line 39
def hash
@hash ||= id.nil? ? signature.hash : id.hash
end
|