Class: Fake
- Inherits:
-
Object
- Object
- Fake
- Defined in:
- lib/fake_csv.rb
Instance Attribute Summary collapse
-
#readfile ⇒ Object
extend self.
-
#writefile ⇒ Object
extend self.
Instance Method Summary collapse
- #format(time, format) ⇒ Object
- #generate_file(folder, filename) ⇒ Object
- #header(header) ⇒ Object
-
#initialize ⇒ Fake
constructor
A new instance of Fake.
- #read_file(file_name) ⇒ Object
Constructor Details
#initialize ⇒ Fake
Returns a new instance of Fake.
13 14 15 |
# File 'lib/fake_csv.rb', line 13 def initialize @readfile = Readfile.new end |
Instance Attribute Details
#readfile ⇒ Object
extend self
11 12 13 |
# File 'lib/fake_csv.rb', line 11 def readfile @readfile end |
#writefile ⇒ Object
extend self
11 12 13 |
# File 'lib/fake_csv.rb', line 11 def writefile @writefile end |
Instance Method Details
#format(time, format) ⇒ Object
25 26 27 28 |
# File 'lib/fake_csv.rb', line 25 def format(time, format) time = "(" + time.to_s + ")" @readfile.format.store(@readfile.format.length+1, :format=>time, :content=>format) end |
#generate_file(folder, filename) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/fake_csv.rb', line 30 def generate_file(folder, filename) writefile = Writefile.new(@readfile.header, folder, filename) g_data = GenerateData.new g_data.generate(@readfile.format) writefile.file(g_data.data) end |
#header(header) ⇒ Object
21 22 23 |
# File 'lib/fake_csv.rb', line 21 def header(header) @readfile.header = header end |
#read_file(file_name) ⇒ Object
17 18 19 |
# File 'lib/fake_csv.rb', line 17 def read_file(file_name) @readfile.read(file_name) end |