Class: RbLatex::ItemList

Inherits:
Object
  • Object
show all
Defined in:
lib/rb_latex/item_list.rb

Instance Method Summary collapse

Constructor Details

#initializeItemList

Returns a new instance of ItemList.



3
4
5
# File 'lib/rb_latex/item_list.rb', line 3

def initialize()
  @items = Hash.new
end

Instance Method Details

#add_item(filename, content) ⇒ Object



7
8
9
# File 'lib/rb_latex/item_list.rb', line 7

def add_item(filename, content)
  @items[filename] = content
end

#filenamesObject



11
12
13
# File 'lib/rb_latex/item_list.rb', line 11

def filenames
  @items.keys
end

#generate(dir) ⇒ Object



15
16
17
18
19
20
# File 'lib/rb_latex/item_list.rb', line 15

def generate(dir)
  @items.each do |filename, content|
    path = File.join(dir, filename)
    File.write(path, content)
  end
end