Class: CategoryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/lib_stats/categorybuilder.rb

Instance Method Summary collapse

Constructor Details

#initializeCategoryBuilder

Returns a new instance of CategoryBuilder.



3
4
5
# File 'lib/lib_stats/categorybuilder.rb', line 3

def initialize

end

Instance Method Details

#build(library, csv_file) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/lib_stats/categorybuilder.rb', line 7

def build(library, csv_file)

	csvreader = CsvReader.new
	csvreader.read_in(csv_file)

	category_array = []
	csvreader.categories.each do |hash|
		category_array << Category.new(library, hash)
	end 

	return category_array
end