Class: FBO::File
- Inherits:
-
Object
show all
- Extended by:
- Forwardable
- Defined in:
- lib/fbo/file.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(filename) ⇒ File
Returns a new instance of File.
17
18
19
|
# File 'lib/fbo/file.rb', line 17
def initialize(filename)
@file = ::File.new(filename)
end
|
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
7
8
9
|
# File 'lib/fbo/file.rb', line 7
def file
@file
end
|
Class Method Details
.filename_for_date(date) ⇒ Object
11
12
13
14
|
# File 'lib/fbo/file.rb', line 11
def filename_for_date(date)
raise ArgumentError, "No date given for file" unless date
"FBOFeed#{ date.strftime("%Y%m%d") }"
end
|
Instance Method Details
#contents ⇒ Object
26
27
28
|
# File 'lib/fbo/file.rb', line 26
def contents
@contents ||= cleanup_data(@file.read)
end
|
#gets ⇒ Object
21
22
23
24
|
# File 'lib/fbo/file.rb', line 21
def gets
str = @file.gets
str.nil? ? nil : cleanup_data(str)
end
|