Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/ex_aequo/base/to_proc/string.rb,
lib/ex_aequo/base/enumerable/string/to_enum.rb
Instance Method Summary collapse
Instance Method Details
#each(chomp: false) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/ex_aequo/base/enumerable/string/to_enum.rb', line 4 def each(chomp: false) File.open self do |fh| (1..) .each { yield fh.readline(chomp:) } .lazy end rescue EOFError end |
#to_proc ⇒ Object
3 4 5 |
# File 'lib/ex_aequo/base/to_proc/string.rb', line 3 def to_proc -> { it.include?(self) ? it : nil } end |