Module: OneSignal::CapnProto::SchemaLoader::Struct
- Defined in:
- lib/one_signal/capn_proto.rb
Instance Method Summary collapse
- #make_from_bytes(bytes) ⇒ Object
- #new_message ⇒ Object
- #read_from(io) ⇒ Object
- #read_packed_from(io) ⇒ Object
- #schema ⇒ Object
Instance Method Details
#make_from_bytes(bytes) ⇒ Object
114 115 116 117 118 |
# File 'lib/one_signal/capn_proto.rb', line 114 def make_from_bytes(bytes) # TODO: support FFI pointers reader = FlatArrayMessageReader.new(bytes) reader.get_root(self) end |
#new_message ⇒ Object
120 121 122 123 |
# File 'lib/one_signal/capn_proto.rb', line 120 def builder = MallocMessageBuilder.new builder.init_root(self) end |
#read_from(io) ⇒ Object
109 110 111 112 |
# File 'lib/one_signal/capn_proto.rb', line 109 def read_from(io) reader = StreamFdMessageReader.new(io) reader.get_root(self) end |
#read_packed_from(io) ⇒ Object
125 126 127 |
# File 'lib/one_signal/capn_proto.rb', line 125 def read_packed_from(io) raise 'not implemented' end |
#schema ⇒ Object
105 106 107 |
# File 'lib/one_signal/capn_proto.rb', line 105 def schema @schema end |