Skip to content

Commit 1e79137

Browse files
committed
Add boolean script support
1 parent bd8111b commit 1e79137

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/sassc/script/value_conversion.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ def self.from_native(native_value, options)
1010
type = Native.string_get_type(native_value)
1111
argument = Script::String.new(value, type)
1212

13+
argument
14+
when :sass_boolean
15+
value = Native.boolean_get_value(native_value)
16+
argument = Script::Boolean.new(value)
17+
1318
argument
1419
when :sass_number
1520
value = Native.number_get_value(native_value)
@@ -64,3 +69,4 @@ def self.to_native(value)
6469
require_relative "value_conversion/number"
6570
require_relative "value_conversion/color"
6671
require_relative "value_conversion/map"
72+
require_relative "value_conversion/boolean"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module SassC
2+
module Script
3+
module ValueConversion
4+
class Boolean < Base
5+
def to_native
6+
Native::make_boolean(@value.value)
7+
end
8+
end
9+
end
10+
end
11+
end

0 commit comments

Comments
 (0)