Class: FackUp::Image::File

Inherits:
Struct
  • Object
show all
Defined in:
lib/fackup/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gidObject

Returns the value of attribute gid

Returns:

  • (Object)

    the current value of gid



22
23
24
# File 'lib/fackup/image.rb', line 22

def gid
  @gid
end

#ioObject

Returns the value of attribute io

Returns:

  • (Object)

    the current value of io



22
23
24
# File 'lib/fackup/image.rb', line 22

def io
  @io
end

#modeObject

Returns the value of attribute mode

Returns:

  • (Object)

    the current value of mode



22
23
24
# File 'lib/fackup/image.rb', line 22

def mode
  @mode
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



22
23
24
# File 'lib/fackup/image.rb', line 22

def name
  @name
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



22
23
24
# File 'lib/fackup/image.rb', line 22

def size
  @size
end

#startObject

Returns the value of attribute start

Returns:

  • (Object)

    the current value of start



22
23
24
# File 'lib/fackup/image.rb', line 22

def start
  @start
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



22
23
24
# File 'lib/fackup/image.rb', line 22

def time
  @time
end

#uidObject

Returns the value of attribute uid

Returns:

  • (Object)

    the current value of uid



22
23
24
# File 'lib/fackup/image.rb', line 22

def uid
  @uid
end

Instance Method Details

#contentObject



27
28
29
30
# File 'lib/fackup/image.rb', line 27

def content
  io.seek(start)
  io.read(size)
end

#packObject



23
24
25
# File 'lib/fackup/image.rb', line 23

def pack
  "%s\0%s" % [name, [time.to_i, start, size, uid, gid, mode].pack(PACK_TEMPLATE)]
end