Module: Mml::Configuration

Defined in:
lib/mml/configuration.rb

Constant Summary collapse

SUPPORTED_TAGS =
%w[
  mmultiscripts
  maligngroup
  malignmark
  munderover
  semantics
  mscarries
  mfraction
  mphantom
  menclose
  mlongdiv
  mpadded
  msubsup
  mscarry
  mfenced
  msgroup
  mglyph
  mstack
  munder
  mtable
  mstyle
  mspace
  msline
  merror
  msrow
  mfrac
  mover
  mroot
  mtext
  msqrt
  none
  mrow
  msub
  msup
  mi
  mo
  mn
  ms
].freeze

Class Method Summary collapse

Class Method Details

.adapterObject



60
61
62
# File 'lib/mml/configuration.rb', line 60

def adapter
  Lutaml::Model::Config.xml_adapter
end

.adapter=(adapter) ⇒ Object



64
65
66
# File 'lib/mml/configuration.rb', line 64

def adapter=(adapter)
  Lutaml::Model::Config.xml_adapter_type = adapter.downcase
end

.class_for(class_name) ⇒ Object



68
69
70
# File 'lib/mml/configuration.rb', line 68

def class_for(class_name)
  config[class_name]
end

.configObject



47
48
49
# File 'lib/mml/configuration.rb', line 47

def config
  @config ||= {}
end

.config=(config) ⇒ Object



51
52
53
# File 'lib/mml/configuration.rb', line 51

def config=(config)
  self.config.merge!(config)
end

.custom_models=(models_hash) ⇒ Object



55
56
57
58
# File 'lib/mml/configuration.rb', line 55

def custom_models=(models_hash)
  # { Mi => CustomMiClass, Mo => CustomMoClass }
  models_hash.each { |klass, model| klass.model(model) }
end