Class: LS4::FileUpdateLog::Record
- Inherits:
-
Object
- Object
- LS4::FileUpdateLog::Record
- Defined in:
- lib/ls4/service/ulog_file.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#reltime ⇒ Object
readonly
Returns the value of attribute reltime.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(reltime, data) ⇒ Record
constructor
A new instance of Record.
- #write(stream) ⇒ Object
Constructor Details
#initialize(reltime, data) ⇒ Record
Returns a new instance of Record.
49 50 51 52 |
# File 'lib/ls4/service/ulog_file.rb', line 49 def initialize(reltime, data) @reltime = reltime @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
55 56 57 |
# File 'lib/ls4/service/ulog_file.rb', line 55 def data @data end |
#reltime ⇒ Object (readonly)
Returns the value of attribute reltime.
54 55 56 |
# File 'lib/ls4/service/ulog_file.rb', line 54 def reltime @reltime end |
Class Method Details
.read(stream) ⇒ Object
71 72 73 |
# File 'lib/ls4/service/ulog_file.rb', line 71 def self.read(stream) new *read_impl(stream, true) end |
.read_nodata(stream) ⇒ Object
75 76 77 |
# File 'lib/ls4/service/ulog_file.rb', line 75 def self.read_nodata(stream) return read_impl(stream, false) end |
Instance Method Details
#write(stream) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ls4/service/ulog_file.rb', line 57 def write(stream) = [@reltime] = .to_msgpack rsize = .size + @data.size brsize = VariableByteCode.encode(rsize) stream.write(brsize) stream.write() stream.write(@data) brsize.size + .size + @data.size end |