Class: String
Instance Method Summary collapse
- #expa ⇒ Object
- #f ⇒ Object
- #p ⇒ Object
- #parse ⇒ Object
- #parse_csv ⇒ Object
- #parse_excel ⇒ Object
- #parse_json ⇒ Object
Instance Method Details
#expa ⇒ Object
6 7 8 |
# File 'lib/arql/ext/string.rb', line 6 def expa File.(self) end |
#f ⇒ Object
10 11 12 |
# File 'lib/arql/ext/string.rb', line 10 def f expa end |
#p ⇒ Object
2 3 4 |
# File 'lib/arql/ext/string.rb', line 2 def p puts self end |
#parse ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/arql/ext/string.rb', line 38 def parse if File.file?(File.(self)) if self =~ /\.xlsx?$/i parse_excel elsif self =~ /\.csv$/i parse_csv elsif self =~ /\.json$/i parse_json else raise "File type not supported: #{self}" end else raise "File not found: #{self}" end end |
#parse_csv ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/arql/ext/string.rb', line 22 def parse_csv if File.file?(File.(self)) Kernel.parse_csv(File.(self)) else raise "File not found: #{self}" end end |
#parse_excel ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/arql/ext/string.rb', line 14 def parse_excel if File.file?(File.(self)) Kernel.parse_excel(File.(self)) else raise "File not found: #{self}" end end |
#parse_json ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/arql/ext/string.rb', line 30 def parse_json if File.file?(File.(self)) Kernel.parse_json(File.(self)) else raise "File not found: #{self}" end end |