Class: ICU::Calendar::Library::ErrorCode

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrorCode

Returns a new instance of ErrorCode.



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

def initialize
  super(:int)
end

Class Method Details

.native_typeObject



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

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

Instance Method Details

#buffer_overflow?Boolean

Returns:

  • (Boolean)


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

def buffer_overflow?
  to_i == U_BUFFER_OVERFLOW_ERROR
end

#failure?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/icu/calendar/library/error_code.rb', line 18

def failure?
  to_i > U_ZERO_ERROR
end

#success?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/icu/calendar/library/error_code.rb', line 22

def success?
  to_i <= U_ZERO_ERROR
end

#to_sObject



28
29
30
# File 'lib/icu/calendar/library/error_code.rb', line 28

def to_s
  Library.u_errorName(to_i)
end