Class: A14z6chElapsedDays::Cli
- Inherits:
-
Thor
- Object
- Thor
- A14z6chElapsedDays::Cli
- Defined in:
- lib/a14z6ch_elapsed_days.rb
Instance Method Summary collapse
- #between(from, to) ⇒ Object
-
#from(date) ⇒ Object
calculating method.
- #version ⇒ Object
Instance Method Details
#between(from, to) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/a14z6ch_elapsed_days.rb', line 42 def between(from, to) begin puts "#{calc(from, to).to_s(:delimited)} days elapsed from the day \"#{from}\" to \"#{to}\".".colorize(:light_magenta) rescue ArgumentError => e if e..nil? puts "given date is not valid.".colorize(:light_blue) else puts e..colorize(:light_blue) end end end |
#from(date) ⇒ Object
calculating method
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/a14z6ch_elapsed_days.rb', line 26 def from(date) begin puts "#{calc(date, Time.now.to_s).to_s(:delimited)} days elapsed from the day \"#{date}\" to NOW.".colorize(:light_magenta) rescue ArgumentError => e if e..nil? puts "given date is not valid.".colorize(:light_blue) else puts e..colorize(:light_blue) end end end |
#version ⇒ Object
17 18 19 |
# File 'lib/a14z6ch_elapsed_days.rb', line 17 def version puts "a14z6ch appilication version : #{A14z6chElapsedDays::VERSION}" end |