module SassC::Native

Constants

SassInputStyle
SassOutputStyle
SassSeparator
SassTag

Public Class Methods

attach_function(*args) click to toggle source

Remove the redundant “sass_” from the beginning of every method name

Calls superclass method
# File lib/sassc/native.rb, line 39
def self.attach_function(*args)
  return super if args.size != 3

  if args[0] =~ /^sass_/
    args.unshift args[0].to_s.sub(/^sass_/, "")
  end

  super(*args)
end
context_get_included_files(*args) click to toggle source
# File lib/sassc/native/native_context_api.rb, line 140
def self.context_get_included_files(*args)
  return_string_array _context_get_included_files(*args)
end
make_data_context(data) click to toggle source
# File lib/sassc/native/native_context_api.rb, line 17
def self.make_data_context(data)
  _make_data_context(Native.native_string(data))
end
native_string(string) click to toggle source
# File lib/sassc/native.rb, line 54
def self.native_string(string)
  m = FFI::MemoryPointer.from_string(string)
  m.autorelease = false
  m
end
return_string_array(ptr) click to toggle source

github.com/ffi/ffi/wiki/Examples#array-of-strings

# File lib/sassc/native.rb, line 50
def self.return_string_array(ptr)
  ptr.null? ? [] : ptr.get_array_of_string(0).compact
end
string_get_type(native_value) click to toggle source
# File lib/sassc/native/native_functions_api.rb, line 84
def self.string_get_type(native_value)
  string_is_quoted(native_value) ? :string : :identifier
end