Class: RoadsinghChouhan::Cli
- Inherits:
-
Thor
- Object
- Thor
- RoadsinghChouhan::Cli
- Defined in:
- lib/roadsingh_chouhan.rb
Instance Method Summary collapse
- #between(from, to) ⇒ Object
-
#from(date) ⇒ Object
calculating method.
- #version ⇒ Object
Instance Method Details
#between(from, to) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/roadsingh_chouhan.rb', line 41 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
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/roadsingh_chouhan.rb', line 25 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
16 17 18 |
# File 'lib/roadsingh_chouhan.rb', line 16 def version puts "a14z6ch appilication version : #{RoadsinghChouhan::VERSION}" end |