Class: MyAge::CLI

Inherits:
Thor
  • Object
show all
Includes:
Calculator
Defined in:
lib/my_age/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Calculator

#age, included, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MyAge::Calculator

Instance Attribute Details

#dobObject

Returns the value of attribute dob.



7
8
9
# File 'lib/my_age/cli.rb', line 7

def dob
  @dob
end

Instance Method Details

#isObject



13
14
15
16
17
# File 'lib/my_age/cli.rb', line 13

def is
  self.dob = get_date(options[:dob])
  date = options[:as_of].present? ? get_date(options[:as_of]) : Date.today
  puts age(date)
end