Class: Lutaml::Jsonschema::Configuration

Inherits:
Base
  • Object
show all
Defined in:
lib/lutaml/jsonschema/configuration.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load_from_file(path) ⇒ Object



24
25
26
27
28
# File 'lib/lutaml/jsonschema/configuration.rb', line 24

def self.load_from_file(path)
  return new unless File.exist?(path)

  from_yaml(File.read(path, encoding: "utf-8"))
end

Instance Method Details

#apply_appearance_overrides(logo:, subtitle:) ⇒ Object



41
42
43
44
45
46
47
48
49
50
# File 'lib/lutaml/jsonschema/configuration.rb', line 41

def apply_appearance_overrides(logo:, subtitle:)
  self.appearance ||= {}
  appearance["logos"] ||= {}
  appearance["logos"]["square"] ||= {}
  if 
    appearance["logos"]["square"]["light"] = { "url" =>  }
    appearance["logos"]["square"]["dark"] = { "url" =>  }
  end
  appearance["subtitle"] = subtitle if subtitle
end

#to_metadataObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/lutaml/jsonschema/configuration.rb', line 30

def 
  Spa::Metadata.new(
    title: title,
    version: version,
    description: description,
    base_url: base_url,
    theme: theme,
    appearance: appearance,
  )
end