Class: Droonga::BufferedTCPSocket::ChunkLoader
- Inherits:
-
Object
- Object
- Droonga::BufferedTCPSocket::ChunkLoader
- Defined in:
- lib/droonga/buffered_tcp_socket.rb
Instance Method Summary collapse
- #have_any_chunk? ⇒ Boolean
-
#initialize(path) ⇒ ChunkLoader
constructor
A new instance of ChunkLoader.
- #load ⇒ Object
Constructor Details
#initialize(path) ⇒ ChunkLoader
Returns a new instance of ChunkLoader.
110 111 112 |
# File 'lib/droonga/buffered_tcp_socket.rb', line 110 def initialize(path) @path = path end |
Instance Method Details
#have_any_chunk? ⇒ Boolean
114 115 116 117 118 119 120 121 |
# File 'lib/droonga/buffered_tcp_socket.rb', line 114 def have_any_chunk? @path.opendir do |dir| dir.each do |entry| return true if entry.end_with?(Chunk::SUFFIX) end end false end |
#load ⇒ Object
123 124 125 126 127 |
# File 'lib/droonga/buffered_tcp_socket.rb', line 123 def load Pathname.glob("#{@path}/*#{Chunk::SUFFIX}").collect do |chunk_path| Chunk.load(chunk_path) end end |