Class: AdLocalize::Requests::ExportRequest
- Inherits:
-
Object
- Object
- AdLocalize::Requests::ExportRequest
- Defined in:
- lib/ad_localize/requests/export_request.rb
Constant Summary collapse
- DEFAULTS =
{ locales: [], bypass_empty_values: false, auto_escape_percent: false, skip_value_stripping: false, csv_paths: [], merge_policy: Interactors::MergeWordings::DEFAULT_POLICY, output_path: Pathname.new('exports'), spreadsheet_id: nil, sheet_ids: %w[0], export_all: false, verbose: false, platforms: Entities::Platform::SUPPORTED_PLATFORMS, downloaded_csvs: [] }
Instance Attribute Summary collapse
-
#auto_escape_percent ⇒ Object
Returns the value of attribute auto_escape_percent.
-
#bypass_empty_values ⇒ Object
Returns the value of attribute bypass_empty_values.
-
#csv_paths ⇒ Object
Returns the value of attribute csv_paths.
-
#downloaded_csvs ⇒ Object
Returns the value of attribute downloaded_csvs.
-
#export_all ⇒ Object
Returns the value of attribute export_all.
-
#locales ⇒ Object
Returns the value of attribute locales.
-
#merge_policy ⇒ Object
Returns the value of attribute merge_policy.
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#platforms ⇒ Object
Returns the value of attribute platforms.
-
#sheet_ids ⇒ Object
Returns the value of attribute sheet_ids.
-
#skip_value_stripping ⇒ Object
Returns the value of attribute skip_value_stripping.
-
#spreadsheet_id ⇒ Object
Returns the value of attribute spreadsheet_id.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #all_csv_paths ⇒ Object
- #has_csv_paths? ⇒ Boolean
- #has_sheets? ⇒ Boolean
-
#initialize ⇒ ExportRequest
constructor
A new instance of ExportRequest.
- #many_platforms? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ ExportRequest
Returns a new instance of ExportRequest.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/ad_localize/requests/export_request.rb', line 39 def initialize @locales = DEFAULTS[:locales] @bypass_empty_values = DEFAULTS[:bypass_empty_values] @auto_escape_percent = DEFAULTS[:auto_escape_percent] @skip_value_stripping = DEFAULTS[:skip_value_stripping] @csv_paths = DEFAULTS[:csv_paths] @merge_policy = DEFAULTS[:merge_policy] @output_path = DEFAULTS[:output_path] @platforms = DEFAULTS[:platforms] @spreadsheet_id = DEFAULTS[:spreadsheet_id] @sheet_ids = DEFAULTS[:sheet_ids] @export_all = DEFAULTS[:export_all] @verbose = DEFAULTS[:verbose] @downloaded_csvs = DEFAULTS[:downloaded_csvs] end |
Instance Attribute Details
#auto_escape_percent ⇒ Object
Returns the value of attribute auto_escape_percent.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def auto_escape_percent @auto_escape_percent end |
#bypass_empty_values ⇒ Object
Returns the value of attribute bypass_empty_values.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def bypass_empty_values @bypass_empty_values end |
#csv_paths ⇒ Object
Returns the value of attribute csv_paths.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def csv_paths @csv_paths end |
#downloaded_csvs ⇒ Object
Returns the value of attribute downloaded_csvs.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def downloaded_csvs @downloaded_csvs end |
#export_all ⇒ Object
Returns the value of attribute export_all.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def export_all @export_all end |
#locales ⇒ Object
Returns the value of attribute locales.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def locales @locales end |
#merge_policy ⇒ Object
Returns the value of attribute merge_policy.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def merge_policy @merge_policy end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
21 22 23 |
# File 'lib/ad_localize/requests/export_request.rb', line 21 def output_dir @output_dir end |
#output_path ⇒ Object
Returns the value of attribute output_path.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def output_path @output_path end |
#platforms ⇒ Object
Returns the value of attribute platforms.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def platforms @platforms end |
#sheet_ids ⇒ Object
Returns the value of attribute sheet_ids.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def sheet_ids @sheet_ids end |
#skip_value_stripping ⇒ Object
Returns the value of attribute skip_value_stripping.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def skip_value_stripping @skip_value_stripping end |
#spreadsheet_id ⇒ Object
Returns the value of attribute spreadsheet_id.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def spreadsheet_id @spreadsheet_id end |
#verbose ⇒ Object
Returns the value of attribute verbose.
23 24 25 |
# File 'lib/ad_localize/requests/export_request.rb', line 23 def verbose @verbose end |
Instance Method Details
#all_csv_paths ⇒ Object
129 130 131 |
# File 'lib/ad_localize/requests/export_request.rb', line 129 def all_csv_paths csv_paths + downloaded_csvs.map(&:path) end |
#has_csv_paths? ⇒ Boolean
121 122 123 |
# File 'lib/ad_localize/requests/export_request.rb', line 121 def has_csv_paths? all_csv_paths.present? end |
#has_sheets? ⇒ Boolean
117 118 119 |
# File 'lib/ad_localize/requests/export_request.rb', line 117 def has_sheets? spreadsheet_id.present? end |
#many_platforms? ⇒ Boolean
125 126 127 |
# File 'lib/ad_localize/requests/export_request.rb', line 125 def many_platforms? platforms.size > 1 end |
#to_s ⇒ Object
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/ad_localize/requests/export_request.rb', line 133 def to_s "locales: #{locales}, " \ "bypass_empty_values: #{bypass_empty_values}, " \ "auto_escape_percent: #{auto_escape_percent}, " \ "skip_value_stripping: #{skip_value_stripping}, " \ "csv_paths: #{csv_paths}, " \ "merge_policy: #{merge_policy}, " \ "output_path: #{output_path}, " \ "spreadsheet_id: #{spreadsheet_id}, " \ "sheet_ids: #{sheet_ids}, " \ "export_all: #{export_all}, " \ "verbose: #{verbose}, " \ "platforms: #{platforms}, " \ "downloaded_csvs: #{downloaded_csvs}" end |