Class: ICU::Calendar::Library::VersionInfo

Inherits:
FFI::MemoryPointer
  • Object
show all
Extended by:
FFI::DataConverter
Defined in:
lib/icu/calendar/library/version_info.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeVersionInfo

Returns a new instance of VersionInfo.



10
11
12
# File 'lib/icu/calendar/library/version_info.rb', line 10

def initialize
  super(:uint8, U_MAX_VERSION_LENGTH)
end

Class Method Details

.native_typeObject



6
7
8
# File 'lib/icu/calendar/library/version_info.rb', line 6

def self.native_type
  FFI::Type::POINTER
end

Instance Method Details

#to_aObject



14
15
16
# File 'lib/icu/calendar/library/version_info.rb', line 14

def to_a
  read_array_of_uint8(U_MAX_VERSION_LENGTH)
end

#to_sObject



18
19
20
21
22
23
# File 'lib/icu/calendar/library/version_info.rb', line 18

def to_s
  FFI::MemoryPointer.new(:char, U_MAX_VERSION_STRING_LENGTH) do |buffer|
    Library.u_versionToString(self, buffer)
    return buffer.read_string_to_null
  end
end