Class: TigerBeetle::Converters::AccountFilter

Inherits:
Base
  • Object
show all
Defined in:
lib/tigerbeetle/converters/account_filter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

from_native, to_native

Class Method Details

.native_typeObject



9
10
11
# File 'lib/tigerbeetle/converters/account_filter.rb', line 9

def self.native_type
  TBClient::AccountFilter
end

Instance Method Details

#from_native(ptr) ⇒ Object



13
14
15
# File 'lib/tigerbeetle/converters/account_filter.rb', line 13

def from_native(ptr)
  raise 'Unexpected conversion of a native type to AccountFilter'
end

#to_native(ptr, value) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tigerbeetle/converters/account_filter.rb', line 17

def to_native(ptr, value)
  TBClient::AccountFilter.new(ptr).tap do |result|
    Converters::UInt128.to_native(result[:account_id].to_ptr, value.)
    Converters::UInt128.to_native(result[:user_data_128].to_ptr, value.user_data_128)
    result[:user_data_64] = value.user_data_64
    result[:user_data_32] = value.user_data_32
    result[:code] = value.code
    Converters::Time.to_native(ptr + result.offset_of(:timestamp_min), value.timestamp_min || 0)
    Converters::Time.to_native(ptr + result.offset_of(:timestamp_max), value.timestamp_max || 0)
    result[:limit] = value.limit
    result[:flags] = value.flags
  end
end