Class: Dovico::ConfigParser
- Inherits:
-
Object
- Object
- Dovico::ConfigParser
- Defined in:
- lib/dovico/config_parser.rb
Constant Summary collapse
- AVAILABLE_ACTIONS =
[:myself, :tasks, :show, :fill, :submit, :clear]
- DATE_REQUIRED_ACTIONS =
[:show, :fill, :submit, :clear]
Instance Method Summary collapse
- #date_options ⇒ Object
-
#initialize(config) ⇒ ConfigParser
constructor
A new instance of ConfigParser.
- #needs_help? ⇒ Boolean
Constructor Details
#initialize(config) ⇒ ConfigParser
Returns a new instance of ConfigParser.
6 7 8 9 |
# File 'lib/dovico/config_parser.rb', line 6 def initialize(config) @config = config @start_date, @end_date = end |
Instance Method Details
#date_options ⇒ Object
23 24 25 |
# File 'lib/dovico/config_parser.rb', line 23 def [start_date, end_date] end |
#needs_help? ⇒ Boolean
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dovico/config_parser.rb', line 11 def needs_help? if config[:help] true elsif AVAILABLE_ACTIONS.map{|action| config[action] }.compact.empty? true elsif !(@start_date && @end_date) && !DATE_REQUIRED_ACTIONS.map{|action| config[action] }.compact.empty? true else false end end |