Class: Expressir::Express::PrettyFormatter::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/expressir/express/pretty_formatter.rb

Overview

Configuration class for MECE parameter management Follows the hierarchy: Options > ENV > Defaults

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Initialize configuration with options, environment variables, or defaults

Parameters:

  • options (Hash) (defaults to: {})

    Configuration options



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/expressir/express/pretty_formatter.rb', line 14

def initialize(options = {})
  @indent = resolve_param(options, :indent, "EXPRESSIR_INDENT", 4)
  @line_length = resolve_param(options, :line_length,
                               "EXPRESSIR_LINE_LENGTH", nil)
  @insert_newline = resolve_param(options, :insert_newline,
                                  "EXPRESSIR_INSERT_NEWLINE", true)
  @insert_space = resolve_param(options, :insert_space,
                                "EXPRESSIR_INSERT_SPACE", true)
  @provenance_enabled = resolve_param(options, :provenance,
                                      "EXPRESSIR_PROVENANCE", true)
  @provenance_name = resolve_param(options, :provenance_name,
                                   "EXPRESSIR_PROVENANCE_NAME", "Expressir")
  @provenance_version = resolve_param(options, :provenance_version,
                                      "EXPRESSIR_PROVENANCE_VERSION", Expressir::VERSION)
end

Instance Attribute Details

#indentObject

Returns the value of attribute indent.



9
10
11
# File 'lib/expressir/express/pretty_formatter.rb', line 9

def indent
  @indent
end

#insert_newlineObject

Returns the value of attribute insert_newline.



9
10
11
# File 'lib/expressir/express/pretty_formatter.rb', line 9

def insert_newline
  @insert_newline
end

#insert_spaceObject

Returns the value of attribute insert_space.



9
10
11
# File 'lib/expressir/express/pretty_formatter.rb', line 9

def insert_space
  @insert_space
end

#line_lengthObject

Returns the value of attribute line_length.



9
10
11
# File 'lib/expressir/express/pretty_formatter.rb', line 9

def line_length
  @line_length
end

#provenance_enabledObject

Returns the value of attribute provenance_enabled.



9
10
11
# File 'lib/expressir/express/pretty_formatter.rb', line 9

def provenance_enabled
  @provenance_enabled
end

#provenance_nameObject

Returns the value of attribute provenance_name.



9
10
11
# File 'lib/expressir/express/pretty_formatter.rb', line 9

def provenance_name
  @provenance_name
end

#provenance_versionObject

Returns the value of attribute provenance_version.



9
10
11
# File 'lib/expressir/express/pretty_formatter.rb', line 9

def provenance_version
  @provenance_version
end