Class: Dummer::Generator::InputMode
- Inherits:
-
AbstractMode
- Object
- AbstractMode
- Dummer::Generator::InputMode
- Defined in:
- lib/dummer/generator/input_mode.rb
Class Method Summary collapse
Methods inherited from AbstractMode
Class Method Details
.message_proc(input) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/dummer/generator/input_mode.rb', line 4 def self.(input) = nil begin open(input) do |in_file| = in_file.readlines end rescue Errno::ENOENT raise ConfigError.new("Input file `#{input}` is not readable") end idx = -1 size = .size Proc.new { idx = (idx + 1) % size [idx] } end |
.record_proc(input) ⇒ Object
21 22 23 24 25 |
# File 'lib/dummer/generator/input_mode.rb', line 21 def self.record_proc(input) # ToDo: implement parser = (input) Proc.new { { "message" => .call } } end |