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_number, #assert_string, #at, #bracketed?, #eql?, #sass_index_to_array_index, #separator, #to_a, #to_bool, #to_map, #to_nil
Constructor Details
#initialize(id) ⇒ Function
#initialize(signature, callback) ⇒ Function
Returns a new instance of Function.
16
17
18
19
20
21
22
23
|
# File 'lib/sass/value/function.rb', line 16
def initialize(id_or_signature, callback = nil)
if id_or_signature.is_a? Numeric
@id = id_or_signature
else
@signature = id_or_signature
@callback = callback
end
end
|
Instance Attribute Details
#callback ⇒ Proc?
32
33
34
|
# File 'lib/sass/value/function.rb', line 32
def callback
@callback
end
|
#id ⇒ Integer?
26
27
28
|
# File 'lib/sass/value/function.rb', line 26
def id
@id
end
|
#signature ⇒ ::String?
29
30
31
|
# File 'lib/sass/value/function.rb', line 29
def signature
@signature
end
|
Instance Method Details
#==(other) ⇒ ::Boolean
35
36
37
38
39
40
41
|
# File 'lib/sass/value/function.rb', line 35
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
49
50
51
|
# File 'lib/sass/value/function.rb', line 49
def assert_function(_name = nil)
self
end
|
#hash ⇒ Integer
44
45
46
|
# File 'lib/sass/value/function.rb', line 44
def hash
id.nil? ? signature.hash : id.hash
end
|