Class: EventMachine::Zipper::Entry

Inherits:
Object
  • Object
show all
Includes:
Deferrable
Defined in:
lib/em-zipper/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path, chunks, out) ⇒ Entry

Returns a new instance of Entry.



8
9
10
11
12
# File 'lib/em-zipper/entry.rb', line 8

def initialize(file_path, chunks, out)
  @file_path = file_path
  @chunks    = chunks
  @out       = out
end

Instance Attribute Details

#chunksObject (readonly)

Returns the value of attribute chunks.



6
7
8
# File 'lib/em-zipper/entry.rb', line 6

def chunks
  @chunks
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



6
7
8
# File 'lib/em-zipper/entry.rb', line 6

def file_path
  @file_path
end

#outObject (readonly)

Returns the value of attribute out.



6
7
8
# File 'lib/em-zipper/entry.rb', line 6

def out
  @out
end

Instance Method Details

#write!Object



14
15
16
17
18
19
# File 'lib/em-zipper/entry.rb', line 14

def write!
  create_entry
  EM.next_tick { chunks.pop(&write_chunks) }

  self
end