Class: Sass::Script::Value::Bool
- Inherits:
- Base
- Object
- Base
- Sass::Script::Value::Bool
- Defined in:
- /Users/ceppstei/Projects/sass-lang/.sass/lib/sass/script/value/bool.rb
Overview
A SassScript object representing a boolean (true or false) value.
Constant Summary
Instance Attribute Summary (collapse)
- - (Boolean) value (also: #to_bool) readonly
The Ruby value of the boolean.
Attributes inherited from Base
Class Method Summary (collapse)
- + (Bool) new(value)
We override object creation so that users of the core API will not need to know that booleans are specific constants.
Instance Method Summary (collapse)
- - (String) to_s(opts = {}) (also: #to_sass)
“true” or “false”.
Methods inherited from Base
#==, #_perform, #assert_int!, #div, #eq, #eql?, #hash, #initialize, #inspect, #minus, #neq, #null?, #plus, #separator, #single_eq, #to_a, #to_h, #to_i, #unary_div, #unary_minus, #unary_not, #unary_plus
Constructor Details
This class inherits a constructor from Sass::Script::Value::Base
Instance Attribute Details
- (Boolean) value (readonly) Also known as: to_bool
The Ruby value of the boolean.
26 27 28 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/script/value/bool.rb', line 26
def value
@value
end |
Class Method Details
+ (Bool) new(value)
We override object creation so that users of the core API will not need to know that booleans are specific constants.
19 20 21 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/script/value/bool.rb', line 19
def self.new(value)
value ? TRUE : FALSE
end |
Instance Method Details
- (String) to_s(opts = {}) Also known as: to_sass
Returns “true” or “false”
30 31 32 | # File '/Users/ceppstei/Projects/sass-lang/.sass/lib/sass/script/value/bool.rb', line 30
def to_s(opts = {})
@value.to_s
end |