Class: RbLatex::ItemList
- Inherits:
-
Object
- Object
- RbLatex::ItemList
- Defined in:
- lib/rb_latex/item_list.rb
Instance Method Summary collapse
- #add_item(filename, content) ⇒ Object
- #filenames ⇒ Object
- #generate(dir) ⇒ Object
-
#initialize ⇒ ItemList
constructor
A new instance of ItemList.
Constructor Details
#initialize ⇒ ItemList
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 |
#filenames ⇒ Object
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 |