Module: System::Collections::ConverterLambdas
Instance Method Summary collapse
- #from_stream(*args) ⇒ Object
- #lines_from_file ⇒ Object
- #to_a ⇒ Object
- #to_array ⇒ Object
- #to_h ⇒ Object
- #to_hash ⇒ Object
- #to_set ⇒ Object
- #to_stream ⇒ Object
Instance Method Details
#from_stream(*args) ⇒ Object
1183 1184 1185 1186 1187 1188 1189 |
# File 'lib/raskell/f.rb', line 1183 def from_stream(*args) if args.length > 0 FromStream.new().(*args) else FromStream.new() end end |
#lines_from_file ⇒ Object
1191 1192 1193 1194 1195 |
# File 'lib/raskell/f.rb', line 1191 def lines_from_file @@lines_from_file||= ->(filepath, ={}) { (['separator'] ? IO.foreach(filepath, ['separator']) : IO.foreach(filepath) ).to_stream } end |
#to_a ⇒ Object
1209 1210 1211 |
# File 'lib/raskell/f.rb', line 1209 def to_a self.to_array end |
#to_array ⇒ Object
1197 1198 1199 |
# File 'lib/raskell/f.rb', line 1197 def to_array FromStream.new(Array) end |
#to_h ⇒ Object
1213 1214 1215 |
# File 'lib/raskell/f.rb', line 1213 def to_h self.to_hash end |
#to_hash ⇒ Object
1201 1202 1203 |
# File 'lib/raskell/f.rb', line 1201 def to_hash FromStream.new(Hash) end |
#to_set ⇒ Object
1205 1206 1207 |
# File 'lib/raskell/f.rb', line 1205 def to_set FromStream.new(Set) end |
#to_stream ⇒ Object
1179 1180 1181 |
# File 'lib/raskell/f.rb', line 1179 def to_stream @@to_stream||= ->(xs) { xs.to_stream } end |