Class: Analects::HskLoader

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/analects/hsk_loader.rb

Defined Under Namespace

Classes: HskEntry

Constant Summary collapse

FIELDS =
[:level, :simplified, :traditional, :pinyin]

Instance Method Summary collapse

Constructor Details

#initialize(io, library) ⇒ HskLoader

Returns a new instance of HskLoader.



21
22
23
24
25
# File 'lib/analects/hsk_loader.rb', line 21

def initialize(io, library)
  @contents = CSV(io.read).map do |level, simplified, traditional, pinyin|
    HskEntry.new(library, level, simplified, traditional, pinyin)
  end
end