Class | BinaryBlocker::FixedUTF16StringEncoder |
In: |
lib/blocker.rb
|
Parent: | SimpleEncoder |
# File lib/blocker.rb, line 399 399: def initialize(*opts) 400: initialize_options(*opts) 401: 402: @length = @opts[:length].to_i 403: @length *= 2 404: raise ArgumentError.new("Missing or invalid string length") unless @length > 0 405: @format = "Z#{@length}" 406: 407: @key = @opts[:key] 408: @valid = @opts[:valid] 409: 410: initialize_data(*opts) 411: end
# File lib/blocker.rb, line 413 413: def internal_block(val) 414: [Uconv.u8tou16(val || "")].pack(@format) 415: end