Class: ChunkIO::ChunkIO
- Inherits:
-
Object
- Object
- ChunkIO::ChunkIO
- Defined in:
- lib/chunkio/chunkio.rb
Instance Method Summary collapse
- #create_chunk(name:) ⇒ Object
-
#initialize(context_path:, stream_name:) ⇒ ChunkIO
constructor
A new instance of ChunkIO.
Constructor Details
#initialize(context_path:, stream_name:) ⇒ ChunkIO
Returns a new instance of ChunkIO.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/chunkio/chunkio.rb', line 7 def initialize(context_path:, stream_name:) unless context_path raise 'invalid' end unless stream_name raise 'stream' end if context_path.empty? raise 'context_path should be at least one char' end if stream_name.empty? raise 'stream_name should be at least one char' end @ctx = ::ChunkIO::Context.new(context_path) @stream = ::ChunkIO::Stream.new(@ctx, stream_name) @chunks = [] end |