Class: CSVPlusPlus::Options::Options
- Inherits:
-
Object
- Object
- CSVPlusPlus::Options::Options
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/csv_plus_plus/options/options.rb
Overview
The options a user can supply (via CLI flags)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#backup ⇒ Boolean
Create a backup of the spreadsheet before writing.
-
#create_if_not_exists ⇒ Boolean
Create the spreadsheet if it does not exist?.
-
#key_values ⇒ Hash
Additional variables that can be supplied to the template.
-
#offset ⇒ Array<Integer>
An [x, y] offset (array with two integers).
-
#overwrite_values ⇒ Boolean
Whether or not to overwrite existing values in the output spreadsheet.
-
#sheet_name ⇒ String
The name of the spreadsheet to write to.
-
#verbose ⇒ Boolean
Include extra verbose output?.
Instance Method Summary collapse
-
#initialize(sheet_name) ⇒ Options
constructor
Initialize a defaul
Optionsobject. -
#output_format ⇒ Options::OutputFormat
Given the options, figure out which type of
OutputFormatwe’ll be writing to. -
#verbose_summary ⇒ String
Return a string with a verbose description of what we’re doing with the options.
Constructor Details
#initialize(sheet_name) ⇒ Options
Initialize a defaul Options object
44 45 46 47 48 49 50 51 52 |
# File 'lib/csv_plus_plus/options/options.rb', line 44 def initialize(sheet_name) @backup = ::T.let(false, ::T::Boolean) @create_if_not_exists = ::T.let(false, ::T::Boolean) @key_values = ::T.let({}, ::T::Hash[::Symbol, ::CSVPlusPlus::Entities::Entity]) @offset = ::T.let([0, 0], ::T::Array[::Integer]) @overwrite_values = ::T.let(true, ::T::Boolean) @sheet_name = sheet_name @verbose = ::T.let(false, ::T::Boolean) end |
Instance Attribute Details
#backup ⇒ Boolean
Create a backup of the spreadsheet before writing
15 16 17 |
# File 'lib/csv_plus_plus/options/options.rb', line 15 def backup @backup end |
#create_if_not_exists ⇒ Boolean
Create the spreadsheet if it does not exist?
15 16 17 |
# File 'lib/csv_plus_plus/options/options.rb', line 15 def create_if_not_exists @create_if_not_exists end |
#key_values ⇒ Hash
Additional variables that can be supplied to the template
15 16 17 |
# File 'lib/csv_plus_plus/options/options.rb', line 15 def key_values @key_values end |
#offset ⇒ Array<Integer>
An [x, y] offset (array with two integers)
15 16 17 |
# File 'lib/csv_plus_plus/options/options.rb', line 15 def offset @offset end |
#overwrite_values ⇒ Boolean
Whether or not to overwrite existing values in the output spreadsheet.
15 16 17 |
# File 'lib/csv_plus_plus/options/options.rb', line 15 def overwrite_values @overwrite_values end |
#sheet_name ⇒ String
The name of the spreadsheet to write to
15 16 17 |
# File 'lib/csv_plus_plus/options/options.rb', line 15 def sheet_name @sheet_name end |
#verbose ⇒ Boolean
Include extra verbose output?
15 16 17 |
# File 'lib/csv_plus_plus/options/options.rb', line 15 def verbose @verbose end |
Instance Method Details
#output_format ⇒ Options::OutputFormat
Given the options, figure out which type of OutputFormat we’ll be writing to
58 |
# File 'lib/csv_plus_plus/options/options.rb', line 58 def output_format; end |
#verbose_summary ⇒ String
Return a string with a verbose description of what we’re doing with the options
64 |
# File 'lib/csv_plus_plus/options/options.rb', line 64 def verbose_summary; end |