Class: BatchIt
- Inherits:
-
Object
- Object
- BatchIt
- Defined in:
- lib/batch_it.rb
Constant Summary collapse
- VERSION =
File.read(File.join(File.dirname(__FILE__),"..","VERSION")).freeze
Instance Attribute Summary collapse
-
#corpus ⇒ Object
readonly
Returns the value of attribute corpus.
Instance Method Summary collapse
-
#initialize(corpus) ⇒ BatchIt
constructor
A new instance of BatchIt.
- #result(data) ⇒ Object
Constructor Details
#initialize(corpus) ⇒ BatchIt
Returns a new instance of BatchIt.
7 8 9 10 |
# File 'lib/batch_it.rb', line 7 def initialize(corpus) @corpus = corpus @erb_template, @markdown_template = Tilt.templates_for("corpus.markdown.erb") end |
Instance Attribute Details
#corpus ⇒ Object (readonly)
Returns the value of attribute corpus.
6 7 8 |
# File 'lib/batch_it.rb', line 6 def corpus @corpus end |
Instance Method Details
#result(data) ⇒ Object
12 13 14 15 16 |
# File 'lib/batch_it.rb', line 12 def result(data) enumerate_over_bindings(data) do |bind| markdown_result(erb_result(corpus, bind)) end end |