Class: Shotgun::Loader::Body

Inherits:
Struct
  • Object
show all
Defined in:
lib/shotgun/loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fdObject

Returns the value of attribute fd



59
60
61
# File 'lib/shotgun/loader.rb', line 59

def fd
  @fd
end

#pidObject

Returns the value of attribute pid



59
60
61
# File 'lib/shotgun/loader.rb', line 59

def pid
  @pid
end

Instance Method Details

#closeObject



66
67
68
69
70
# File 'lib/shotgun/loader.rb', line 66

def close
  fd.close
ensure
  Process.wait(pid)
end

#eachObject



60
61
62
63
64
# File 'lib/shotgun/loader.rb', line 60

def each
  while chunk = fd.read(1024)
    yield chunk
  end
end