lib/ffi-icu/collation.rb in ffi-icu-0.1.2 vs lib/ffi-icu/collation.rb in ffi-icu-0.1.3
- old
+ new
@@ -74,9 +74,17 @@
raise ArgumentError, "argument must respond to :sort with arity of 2"
end
sortable.sort { |a, b| compare a, b }
end
+
+ def rules
+ @rules ||= begin
+ length = FFI::MemoryPointer.new(:int)
+ ptr = ICU::Lib.ucol_getRules(@c, length)
+ ptr.read_array_of_uint16(length.read_int).pack("U*")
+ end
+ end
end # Collator
end # Collate
end # ICU