Class: EditorConfigGenerator::OptionTransformer
- Inherits:
-
Object
- Object
- EditorConfigGenerator::OptionTransformer
- Defined in:
- lib/editorconfig/option_transformer.rb
Overview
Transforms options given to an EditorConfig object
Class Method Summary collapse
- .transform_final_newline_option(options) ⇒ Object
- .transform_options(options) ⇒ Object
- .transform_root_option(options) ⇒ Object
- .transform_whitespace_option(options) ⇒ Object
Class Method Details
.transform_final_newline_option(options) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/editorconfig/option_transformer.rb', line 10 def self.transform_final_newline_option() if [:insert_final_newline] == 'y' [:insert_final_newline] = true elsif [:insert_final_newline] == 'n' [:insert_final_newline] = false end end |
.transform_options(options) ⇒ Object
4 5 6 7 8 |
# File 'lib/editorconfig/option_transformer.rb', line 4 def self.() transform_root_option() transform_whitespace_option() transform_final_newline_option() end |
.transform_root_option(options) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/editorconfig/option_transformer.rb', line 26 def self.transform_root_option() if [:root] == 'y' [:root] = true elsif [:root] == 'n' [:root] = false end end |
.transform_whitespace_option(options) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/editorconfig/option_transformer.rb', line 18 def self.transform_whitespace_option() if [:trim_trailing_whitespace] == 'y' [:trim_trailing_whitespace] = true elsif [:trim_trailing_whitespace] == 'n' [:trim_trailing_whitespace] = false end end |