Class: RoadsinghChouhan::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/roadsingh_chouhan.rb

Instance Method Summary collapse

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.message.nil?
      puts "given date is not valid.".colorize(:light_blue)
    else
      puts e.message.colorize(:light_blue)
    end
  end
end

#from(date) ⇒ Object

calculating method

Parameters:

  • from

    date



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.message.nil?
      puts "given date is not valid.".colorize(:light_blue)
    else
      puts e.message.colorize(:light_blue)
    end
  end
end

#versionObject



16
17
18
# File 'lib/roadsingh_chouhan.rb', line 16

def version
  puts "a14z6ch appilication version : #{RoadsinghChouhan::VERSION}"
end