Class: TranscationAPI
Constant Summary
collapse
- @@file_path =
File.join(File.dirname(caller[0]), "/FileStorage/transcations.log")
Class Method Summary
collapse
add_line, read_file, remove_line, update_line
Class Method Details
.get_list ⇒ Object
21
22
23
|
# File 'lib/TranscationAPI.rb', line 21
def self.get_list
@@list
end
|
.record(transcation) ⇒ Object
13
14
15
16
17
18
19
|
# File 'lib/TranscationAPI.rb', line 13
def self.record(transcation)
@@list ||= Array.new
transcation[:id] = @@list.size
@@list.push(transcation)
puts "TranscationAPI#record: Recording a transcation with these details: #{transcation}"
add_line(@@file_path, transcation)
end
|
.seed ⇒ Object
9
10
11
|
# File 'lib/TranscationAPI.rb', line 9
def self.seed
@@list = read_file(@@file_path)
end
|