Class: Ekylibre::Abaci

Inherits:
Object
  • Object
show all
Defined in:
lib/ekylibre/abaci.rb

Overview

Handles abaci stored in config/abaci

Class Method Summary collapse

Class Method Details

.abaci_fileObject


10
11
12
# File 'lib/ekylibre/abaci.rb', line 10

def self.abaci_file
  Rails.root.join('config', 'abaci', abaci_name)
end

.abaci_name(extension = 'csv') ⇒ Object


14
15
16
17
18
# File 'lib/ekylibre/abaci.rb', line 14

def self.abaci_name(extension = 'csv')
  abacus_name = name.underscore
  name_without_abacus = abacus_name.split('_abacus').first
  "#{name_without_abacus}.#{extension}"
end

.loadObject


4
5
6
7
# File 'lib/ekylibre/abaci.rb', line 4

def self.load
  @data = CSV.open(abaci_file, headers: true).read
  true
end