Class: BitConverter::CLI
- Inherits:
-
Thor
- Object
- Thor
- BitConverter::CLI
- Defined in:
- lib/bit_converter/cli.rb
Instance Method Summary collapse
Instance Method Details
#convert(amount, from, to) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/bit_converter/cli.rb', line 14 def convert(amount, from, to) puts BitConverter::Convert.pretty_convert(amount: amount.to_f, from: from, to: to) rescue RuntimeError => e puts e. end |
#ping ⇒ Object
9 10 11 |
# File 'lib/bit_converter/cli.rb', line 9 def ping puts BitConverter::Ping.ping end |
#rate(from, to) ⇒ Object
23 24 25 |
# File 'lib/bit_converter/cli.rb', line 23 def rate(from, to) convert(1, from, to) end |