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
47
48
49
50
51
52
53
# File 'lib/fbo/segmented_file.rb', line 35

def contents
  @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 ].compact
end

#contents_for_type(type) ⇒ Object



55
56
57
58
59
# File 'lib/fbo/segmented_file.rb', line 55

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