Class: Expressir::Express::PrettyFormatter

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

Overview

Pretty formatter for EXPRESS schemas following ELF specification

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Attributes inherited from Formatter

#no_remarks

Instance Method Summary collapse

Methods inherited from Formatter

format, #format

Methods included from Formatters::RemarkItemFormatter

#format_remark_item

Constructor Details

#initialize(options = {}) ⇒ PrettyFormatter

Initialize PrettyFormatter with options

Parameters:

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

    Formatting options

Options Hash (options):

  • :indent (Integer)

    Number of spaces per indentation level (default: 4)

  • :line_length (Integer, nil)

    Maximum line length (default: nil)

  • :insert_newline (Boolean)

    Insert newlines for readability (default: true)

  • :insert_space (Boolean)

    Insert spaces for readability (default: true)

  • :provenance (Boolean)

    Include provenance information (default: true)

  • :provenance_name (String)

    Tool name for provenance (default: “Expressir”)

  • :provenance_version (String)

    Tool version for provenance (default: Expressir::VERSION)

  • :no_remarks (Boolean)

    Suppress remarks in output (default: false)



72
73
74
75
# File 'lib/expressir/express/pretty_formatter.rb', line 72

def initialize(options = {})
  @config = Configuration.new(options)
  super(no_remarks: options.fetch(:no_remarks, false))
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



60
61
62
# File 'lib/expressir/express/pretty_formatter.rb', line 60

def config
  @config
end