Class: Caseconv::App

Inherits:
Object
  • Object
show all
Defined in:
lib/caseconv/app.rb

Instance Method Summary collapse

Instance Method Details

#convert(str, case_type) ⇒ Object



28
29
30
# File 'lib/caseconv/app.rb', line 28

def convert(str, case_type)
  str.send(case_type)
end

#convert_file(file, case_type) ⇒ Object



22
23
24
25
26
# File 'lib/caseconv/app.rb', line 22

def convert_file(file, case_type)
  file.map do |line|
    convert(line.chomp, case_type)
  end
end

#main(args) ⇒ Object



16
17
18
19
20
# File 'lib/caseconv/app.rb', line 16

def main(args)
  Caseconv::Cli.start(args)
rescue StandardError => e
  STDERR.puts(e.message)
end