Created
April 18, 2012 21:42
-
-
Save metaskills/2416795 to your computer and use it in GitHub Desktop.
Custom Sass Function For stringinclude(a, b)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sass::Script | |
class String < Literal | |
def include?(other) | |
value.include? other.value | |
end | |
end | |
end | |
module Sass::Script::Functions | |
def stringinclude(str, value) | |
assert_type str, :String | |
assert_type value, :String | |
Sass::Script::Bool.new(str.include?(value)) | |
end | |
declare :stringinclude, [:str, :value] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment