Class: Sass::Value::Boolean
- Inherits:
-
Object
- Object
- Sass::Value::Boolean
show all
- Includes:
- Sass::Value
- Defined in:
- lib/sass/value/boolean.rb
Overview
Constant Summary
collapse
- TRUE =
Boolean.new(true)
- FALSE =
Boolean.new(false)
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#[], #assert_calculation, #assert_color, #assert_function, #assert_map, #assert_mixin, #assert_number, #assert_string, #at, #bracketed?, #eql?, #sass_index_to_array_index, #separator, #to_a, #to_map, #to_nil
Constructor Details
#initialize(value) ⇒ Boolean
Returns a new instance of Boolean.
12
13
14
|
# File 'lib/sass/value/boolean.rb', line 12
def initialize(value)
@value = value
end
|
Instance Attribute Details
#value ⇒ ::Boolean
Also known as:
to_bool
17
18
19
|
# File 'lib/sass/value/boolean.rb', line 17
def value
@value
end
|
Class Method Details
.new(value) ⇒ Object
47
48
49
|
# File 'lib/sass/value/boolean.rb', line 47
def self.new(value)
value ? Boolean::TRUE : Boolean::FALSE
end
|
Instance Method Details
#==(other) ⇒ ::Boolean
25
26
27
|
# File 'lib/sass/value/boolean.rb', line 25
def ==(other)
other.is_a?(Sass::Value::Boolean) && other.value == value
end
|
#assert_boolean(_name = nil) ⇒ Boolean
37
38
39
|
# File 'lib/sass/value/boolean.rb', line 37
def assert_boolean(_name = nil)
self
end
|
#hash ⇒ Integer
30
31
32
|
# File 'lib/sass/value/boolean.rb', line 30
def hash
@hash ||= value.hash
end
|