Class: OptimistXL::ChronicDateOption

Inherits:
Option
  • Object
show all
Defined in:
lib/optimist_xl/chronic.rb

Overview

Option for dates using Chronic gem. Mainly for compatibility with Optimist. Use of Chronic switches to United States formatted dates (MM/DD/YYYY) as opposed to DD/MM/YYYY

Instance Attribute Summary

Attributes inherited from Option

#default, #long, #max_args, #min_args, #multi_given, #name, #permitted, #permitted_response, #short

Instance Method Summary collapse

Methods inherited from Option

#array_default?, #callback, #compatible_with?, create, #desc, #description_with_default, #description_with_permitted, #doesnt_need_autogen_short, #educate, #format_stdio, #full_description, handle_long_opt, handle_short_opt, #initialize, #multi, #opts, #opts=, #permitted_type_valid?, #permitted_valid_string, #permitted_value?, register_alias, #required?, #validate_permitted

Constructor Details

This class inherits a constructor from OptimistXL::Option

Instance Method Details

#parse(paramlist, _neg_given) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/optimist_xl/chronic.rb', line 15

def parse(paramlist, _neg_given)
  paramlist.map do |pg|
    pg.map do |param|
      parse_date_param(param)
    end
  end
end

#type_formatObject



14
# File 'lib/optimist_xl/chronic.rb', line 14

def type_format ; "=<date>" ; end