Class: UndriveGoogle::Options
- Inherits:
-
Object
- Object
- UndriveGoogle::Options
- Includes:
- Singleton
- Defined in:
- lib/undrive_google/options.rb
Overview
Combine defaults with YAML and CLI provided options
Instance Attribute Summary collapse
-
#config_yaml ⇒ Object
Returns the value of attribute config_yaml.
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#extensions ⇒ Object
Returns the value of attribute extensions.
-
#file_by ⇒ Object
Returns the value of attribute file_by.
-
#file_id ⇒ Object
Returns the value of attribute file_id.
-
#keep_zip ⇒ Object
Returns the value of attribute keep_zip.
-
#key_file ⇒ Object
Returns the value of attribute key_file.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#rename ⇒ Object
Returns the value of attribute rename.
-
#rename_proc ⇒ Object
Returns the value of attribute rename_proc.
-
#sweep ⇒ Object
Returns the value of attribute sweep.
-
#title ⇒ Object
Returns the value of attribute title.
-
#unzip ⇒ Object
Returns the value of attribute unzip.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #define_options(parser) ⇒ Object
-
#initialize ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
12 13 14 |
# File 'lib/undrive_google/options.rb', line 12 def initialize load_yaml(true) end |
Instance Attribute Details
#config_yaml ⇒ Object
Returns the value of attribute config_yaml.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def config_yaml @config_yaml end |
#dir ⇒ Object
Returns the value of attribute dir.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def dir @dir end |
#extensions ⇒ Object
Returns the value of attribute extensions.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def extensions @extensions end |
#file_by ⇒ Object
Returns the value of attribute file_by.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def file_by @file_by end |
#file_id ⇒ Object
Returns the value of attribute file_id.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def file_id @file_id end |
#keep_zip ⇒ Object
Returns the value of attribute keep_zip.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def keep_zip @keep_zip end |
#key_file ⇒ Object
Returns the value of attribute key_file.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def key_file @key_file end |
#lang ⇒ Object
Returns the value of attribute lang.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def lang @lang end |
#rename ⇒ Object
Returns the value of attribute rename.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def rename @rename end |
#rename_proc ⇒ Object
Returns the value of attribute rename_proc.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def rename_proc @rename_proc end |
#sweep ⇒ Object
Returns the value of attribute sweep.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def sweep @sweep end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def title @title end |
#unzip ⇒ Object
Returns the value of attribute unzip.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def unzip @unzip end |
#verbose ⇒ Object
Returns the value of attribute verbose.
8 9 10 |
# File 'lib/undrive_google/options.rb', line 8 def verbose @verbose end |
Instance Method Details
#define_options(parser) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/undrive_google/options.rb', line 16 def (parser) parser. = "Usage: undrive_google [options]" parser.separator "" # Handle YAML, as default overrides config_yaml_option(parser) # ARGV will override the defaults and YAML values key_file_option(parser) file_id_option(parser) by_option(parser) extensions_option(parser) unzip_option(parser) keep_zip_option(parser) (parser) dir_option(parser) lang_option(parser) title_option(parser) sweep_option(parser) verbose_option(parser) parser.separator "" # Print an options summary. parser.on_tail("-h", "--help", "Show this message") do puts parser exit end end |