Class: FBO::SegmentedFile

Inherits:
File
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/fbo/segmented_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from File

filename_for_date, #gets

Constructor Details

#initialize(file) ⇒ SegmentedFile

Returns a new instance of SegmentedFile.



11
12
13
# File 'lib/fbo/segmented_file.rb', line 11

def initialize(file)
  @file = file
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/fbo/segmented_file.rb', line 7

def file
  @file
end

Instance Method Details

#contentsObject



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fbo/segmented_file.rb', line 35

def contents
  if @contents.nil?
    @contents = [ presol_contents, combine_contents, amdcss_contents,
                  mod_contents, award_contents, ja_contents, itb_contents,
                  fairopp_contents, srcsgt_contents, fstd_contents,
                  snote_contents, ssale_contents, epsupload_contents,
                  delete_contents, archive_contents, unarchive_contents ]
    @contents.compact!
    #@contents = @file.contents
  end
  @contents
end

#contents_for_type(type) ⇒ Object



48
49
50
51
52
# File 'lib/fbo/segmented_file.rb', line 48

def contents_for_type(type)
  return unless type
  method_name = "#{ type }_contents"
  self.respond_to?(method_name) ? self.send(method_name) : nil 
end