Class: YandexDisk::Chunked

Inherits:
Object show all
Defined in:
lib/yandex_disk/chunked.rb

Instance Method Summary collapse

Constructor Details

#initialize(data, chunk_size) ⇒ Chunked

Returns a new instance of Chunked.



4
5
6
7
8
9
# File 'lib/yandex_disk/chunked.rb', line 4

def initialize(data, chunk_size)
  @size = chunk_size
  if data.respond_to? :read
    @file = data
  end
end

Instance Method Details

#eof!Object



16
17
18
# File 'lib/yandex_disk/chunked.rb', line 16

def eof!
  @file.eof!
end

#eof?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/yandex_disk/chunked.rb', line 19

def eof?
  @file.eof?
end

#read(foo) ⇒ Object



11
12
13
14
15
# File 'lib/yandex_disk/chunked.rb', line 11

def read(foo)
  if @file
    @file.read(@size)
  end
end