Class: RbSDL2::RWObject::SizeCallback
- Inherits:
-
FFI::Function
- Object
- FFI::Function
- RbSDL2::RWObject::SizeCallback
- Defined in:
- lib/rb_sdl2/rw_ops/rw_object.rb
Instance Method Summary collapse
-
#initialize ⇒ SizeCallback
constructor
A new instance of SizeCallback.
Constructor Details
#initialize ⇒ SizeCallback
Returns a new instance of SizeCallback.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/rb_sdl2/rw_ops/rw_object.rb', line 56 def initialize # Sint64 (* size) (struct RWops * context); super(:int64, [:pointer]) do |_context| # Ruby ではサイズが不明な IO は size メソッドが無い(NoMethodError)。 yield rescue => e raise e if $DEBUG Error. = e. # 不明な時は -1。 -1 end end |