Class: WebIde::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/web_ide/config.rb,
lib/web_ide/config/entry/global.rb,
lib/web_ide/config/entry/terminal.rb

Overview

Base GitLab WebIde Configuration facade

Defined Under Namespace

Modules: Entry

Constant Summary collapse

ConfigError =
Class.new(StandardError)

Instance Method Summary collapse

Constructor Details

#initialize(config, opts = {}) ⇒ Config

Returns a new instance of Config.



10
11
12
13
14
15
16
17
18
# File 'lib/web_ide/config.rb', line 10

def initialize(config, opts = {})
  @config = build_config(config, opts)

  @global = Entry::Global.new(@config,
    with_image_ports: true)
  @global.compose!
rescue Gitlab::Config::Loader::FormatError => e
  raise Config::ConfigError, e.message
end

Instance Method Details

#errorsObject



24
25
26
# File 'lib/web_ide/config.rb', line 24

def errors
  @global.errors
end

#schemas_valueObject



36
37
38
# File 'lib/web_ide/config.rb', line 36

def schemas_value
  @global.schemas_value
end

#terminal_valueObject



32
33
34
# File 'lib/web_ide/config.rb', line 32

def terminal_value
  @global.terminal_value
end

#to_hashObject



28
29
30
# File 'lib/web_ide/config.rb', line 28

def to_hash
  @config
end

#valid?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/web_ide/config.rb', line 20

def valid?
  @global.valid?
end