Class: DiscordStore::Log::Buffer
- Inherits:
-
Object
- Object
- DiscordStore::Log::Buffer
- Defined in:
- lib/discord_store/log.rb
Overview
Collects records for #transaction.
Instance Attribute Summary collapse
-
#records ⇒ Object
readonly
Returns the value of attribute records.
Instance Method Summary collapse
- #append(stream:, data:, nonce: nil) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ Buffer
constructor
A new instance of Buffer.
- #size ⇒ Object
Constructor Details
#initialize ⇒ Buffer
Returns a new instance of Buffer.
287 |
# File 'lib/discord_store/log.rb', line 287 def initialize = @records = [] |
Instance Attribute Details
#records ⇒ Object (readonly)
Returns the value of attribute records.
285 286 287 |
# File 'lib/discord_store/log.rb', line 285 def records @records end |
Instance Method Details
#append(stream:, data:, nonce: nil) ⇒ Object
289 290 291 292 293 |
# File 'lib/discord_store/log.rb', line 289 def append(stream:, data:, nonce: nil) record = Record.new(stream: stream, data: data, nonce: nonce) @records << record record end |
#empty? ⇒ Boolean
295 |
# File 'lib/discord_store/log.rb', line 295 def empty? = @records.empty? |
#size ⇒ Object
296 |
# File 'lib/discord_store/log.rb', line 296 def size = @records.size |