metaschema 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/.rubocop_todo.yml +18 -0
  4. data/Rakefile +3 -3
  5. data/exe/metaschema +2 -2
  6. data/lib/metaschema/allowed_value_type.rb +24 -22
  7. data/lib/metaschema/allowed_values_type.rb +21 -19
  8. data/lib/metaschema/anchor_type.rb +19 -17
  9. data/lib/metaschema/any_type.rb +5 -3
  10. data/lib/metaschema/assembly.rb +24 -22
  11. data/lib/metaschema/assembly_model_type.rb +19 -17
  12. data/lib/metaschema/assembly_reference_type.rb +23 -21
  13. data/lib/metaschema/block_quote_type.rb +25 -23
  14. data/lib/metaschema/choice_type.rb +13 -11
  15. data/lib/metaschema/code_type.rb +23 -21
  16. data/lib/metaschema/constraint_let_type.rb +9 -7
  17. data/lib/metaschema/define_assembly_constraints_type.rb +23 -21
  18. data/lib/metaschema/define_field_constraints_type.rb +17 -15
  19. data/lib/metaschema/define_flag_constraints_type.rb +17 -15
  20. data/lib/metaschema/example_type.rb +11 -9
  21. data/lib/metaschema/expect_constraint_type.rb +17 -15
  22. data/lib/metaschema/field.rb +18 -16
  23. data/lib/metaschema/field_reference_type.rb +26 -24
  24. data/lib/metaschema/flag.rb +18 -16
  25. data/lib/metaschema/flag_reference_type.rb +20 -18
  26. data/lib/metaschema/global_assembly_definition_type.rb +33 -31
  27. data/lib/metaschema/global_field_definition_type.rb +37 -33
  28. data/lib/metaschema/global_flag_definition_type.rb +26 -24
  29. data/lib/metaschema/group_as_type.rb +10 -8
  30. data/lib/metaschema/grouped_assembly_reference_type.rb +17 -15
  31. data/lib/metaschema/grouped_choice_type.rb +23 -21
  32. data/lib/metaschema/grouped_field_reference_type.rb +17 -15
  33. data/lib/metaschema/grouped_inline_assembly_definition_type.rb +28 -26
  34. data/lib/metaschema/grouped_inline_field_definition_type.rb +35 -33
  35. data/lib/metaschema/image_type.rb +8 -6
  36. data/lib/metaschema/import.rb +6 -4
  37. data/lib/metaschema/index_has_key_constraint_type.rb +18 -16
  38. data/lib/metaschema/inline_assembly_definition_type.rb +35 -33
  39. data/lib/metaschema/inline_field_definition_type.rb +41 -39
  40. data/lib/metaschema/inline_flag_definition_type.rb +24 -22
  41. data/lib/metaschema/inline_markup_type.rb +19 -17
  42. data/lib/metaschema/insert_type.rb +7 -5
  43. data/lib/metaschema/json_key_type.rb +6 -4
  44. data/lib/metaschema/json_value_key_flag_type.rb +6 -4
  45. data/lib/metaschema/key_field.rb +9 -7
  46. data/lib/metaschema/list_item_type.rb +36 -34
  47. data/lib/metaschema/list_type.rb +7 -5
  48. data/lib/metaschema/markup_line_datatype.rb +22 -20
  49. data/lib/metaschema/matches_constraint_type.rb +17 -15
  50. data/lib/metaschema/metaschema_import_type.rb +6 -4
  51. data/lib/metaschema/metaschemaconstraints.rb +15 -13
  52. data/lib/metaschema/namespace_binding_type.rb +7 -5
  53. data/lib/metaschema/ordered_list_type.rb +7 -5
  54. data/lib/metaschema/preformatted_type.rb +22 -20
  55. data/lib/metaschema/property_type.rb +9 -7
  56. data/lib/metaschema/remarks_type.rb +28 -26
  57. data/lib/metaschema/root.rb +27 -25
  58. data/lib/metaschema/root_name.rb +6 -4
  59. data/lib/metaschema/scope.rb +13 -11
  60. data/lib/metaschema/table_cell_type.rb +24 -22
  61. data/lib/metaschema/table_row_type.rb +8 -6
  62. data/lib/metaschema/table_type.rb +7 -5
  63. data/lib/metaschema/targeted_allowed_values_constraint_type.rb +22 -20
  64. data/lib/metaschema/targeted_expect_constraint_type.rb +18 -16
  65. data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +18 -16
  66. data/lib/metaschema/targeted_index_constraint_type.rb +19 -17
  67. data/lib/metaschema/targeted_index_has_key_constraint_type.rb +19 -17
  68. data/lib/metaschema/targeted_key_constraint_type.rb +18 -16
  69. data/lib/metaschema/targeted_matches_constraint_type.rb +18 -16
  70. data/lib/metaschema/use_name_type.rb +6 -4
  71. data/lib/metaschema/version.rb +1 -1
  72. data/lib/metaschema.rb +4 -4
  73. metadata +8 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96ded33102abf61d6bebf9eeb5ae94432fa3ef93317d7cc63fefeada76cf3e1b
4
- data.tar.gz: fb9b812a3407d39927a7fb3d4955c902e3559338a393f0edeed8223212745803
3
+ metadata.gz: 60b00aaab348d3f988738d342131af2960af449c6476284f372017a884b609ea
4
+ data.tar.gz: 3d1105245b18f7db1269698ee5aaf68bc7f0c2cb40dde4efd00a6d7ba068bfc0
5
5
  SHA512:
6
- metadata.gz: d4e7ea5033073e84c24375688b351f59be2c9b2787968160ab79f71a5c4e46346262710ff5952647529d0927b88d982d8c76ec178bf9e0a5b974e60e218a5405
7
- data.tar.gz: 6e3b3ee833410b6fa2398e7ada654e0f7ec3d3b1ff87a440d0cdef046b4d3379d28707799c1f0ed644ed6bb0a4ccefcf3a352f5c715c4a99bc14e85b0d9efac3
6
+ metadata.gz: d15f2fb39b07d584bbcbb30ea497281ea9f38068ca978a746ed1afc00889e2823b89101259edb3b3c27a010b671f9c6992daed8c0db081726a1b33219fe09797
7
+ data.tar.gz: 0cbe2b526a88045f7ea3cb8d75165bf00fa4c7d52cf64ea830bfd69755cedae2d77d24d7b891c9df981b32e5ce31df49294d9e62bf5c59daeca55d6c1d85dfc0
data/.rubocop.yml ADDED
@@ -0,0 +1 @@
1
+ inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,18 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2025-01-06 00:55:21 UTC using RuboCop version 1.69.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 3
10
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
11
+ # AllowedMethods: refine
12
+ Metrics/BlockLength:
13
+ Max: 44
14
+
15
+ # Offense count: 66
16
+ # Configuration parameters: AllowedConstants.
17
+ Style/Documentation:
18
+ Enabled: false
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- require "rubocop/rake_task"
8
+ require 'rubocop/rake_task'
9
9
 
10
10
  RuboCop::RakeTask.new
11
11
 
data/exe/metaschema CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require_relative "../lib/metaschema"
5
- require_relative "../lib/metaschema/cli"
4
+ require_relative '../lib/metaschema'
5
+ require_relative '../lib/metaschema/cli'
6
6
 
7
7
  Metaschema::Cli::Commands.start(ARGV)
@@ -1,10 +1,12 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "anchor_type"
4
- require_relative "code_type"
5
- require_relative "image_type"
6
- require_relative "inline_markup_type"
7
- require_relative "insert_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'anchor_type'
6
+ require_relative 'code_type'
7
+ require_relative 'image_type'
8
+ require_relative 'inline_markup_type'
9
+ require_relative 'insert_type'
8
10
 
9
11
  module Metaschema
10
12
  class AllowedValueType < Lutaml::Model::Serializable
@@ -25,24 +27,24 @@ module Metaschema
25
27
  attribute :img, ImageType, collection: true
26
28
 
27
29
  xml do
28
- root "AllowedValueType"
29
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
30
+ root 'AllowedValueType', mixed: true
31
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
30
32
 
31
33
  map_content to: :content
32
- map_attribute "value", to: :value
33
- map_attribute "deprecated", to: :deprecated
34
- map_element "a", to: :a
35
- map_element "insert", to: :insert
36
- map_element "br", to: :br
37
- map_element "code", to: :code
38
- map_element "em", to: :em
39
- map_element "i", to: :i
40
- map_element "b", to: :b
41
- map_element "strong", to: :strong
42
- map_element "sub", to: :sub
43
- map_element "sup", to: :sup
44
- map_element "q", to: :q
45
- map_element "img", to: :img
34
+ map_attribute 'value', to: :value
35
+ map_attribute 'deprecated', to: :deprecated
36
+ map_element 'a', to: :a
37
+ map_element 'insert', to: :insert
38
+ map_element 'br', to: :br
39
+ map_element 'code', to: :code
40
+ map_element 'em', to: :em
41
+ map_element 'i', to: :i
42
+ map_element 'b', to: :b
43
+ map_element 'strong', to: :strong
44
+ map_element 'sub', to: :sub
45
+ map_element 'sup', to: :sup
46
+ map_element 'q', to: :q
47
+ map_element 'img', to: :img
46
48
  end
47
49
  end
48
50
  end
@@ -1,16 +1,18 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "allowed_value_type"
4
- require_relative "markup_line_datatype"
5
- require_relative "property_type"
6
- require_relative "remarks_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'allowed_value_type'
6
+ require_relative 'markup_line_datatype'
7
+ require_relative 'property_type'
8
+ require_relative 'remarks_type'
7
9
 
8
10
  module Metaschema
9
11
  class AllowedValuesType < Lutaml::Model::Serializable
10
12
  attribute :id, :string
11
- attribute :level, :string, default: -> { "ERROR" }
12
- attribute :allow_other, :string, default: -> { "no" }
13
- attribute :extensible, :string, default: -> { "external" }
13
+ attribute :level, :string, default: -> { 'ERROR' }
14
+ attribute :allow_other, :string, default: -> { 'no' }
15
+ attribute :extensible, :string, default: -> { 'external' }
14
16
  attribute :formal_name, :string
15
17
  attribute :description, MarkupLineDatatype
16
18
  attribute :prop, PropertyType, collection: true
@@ -18,18 +20,18 @@ module Metaschema
18
20
  attribute :remarks, RemarksType
19
21
 
20
22
  xml do
21
- root "AllowedValuesType"
22
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
23
+ root 'AllowedValuesType'
24
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
23
25
 
24
- map_attribute "id", to: :id
25
- map_attribute "level", to: :level
26
- map_attribute "allow-other", to: :allow_other
27
- map_attribute "extensible", to: :extensible
28
- map_element "formal-name", to: :formal_name
29
- map_element "description", to: :description
30
- map_element "prop", to: :prop
31
- map_element "enum", to: :enum
32
- map_element "remarks", to: :remarks
26
+ map_attribute 'id', to: :id
27
+ map_attribute 'level', to: :level
28
+ map_attribute 'allow-other', to: :allow_other
29
+ map_attribute 'extensible', to: :extensible
30
+ map_element 'formal-name', to: :formal_name
31
+ map_element 'description', to: :description
32
+ map_element 'prop', to: :prop
33
+ map_element 'enum', to: :enum
34
+ map_element 'remarks', to: :remarks
33
35
  end
34
36
  end
35
37
  end
@@ -1,8 +1,10 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "code_type"
4
- require_relative "image_type"
5
- require_relative "inline_markup_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'code_type'
6
+ require_relative 'image_type'
7
+ require_relative 'inline_markup_type'
6
8
 
7
9
  module Metaschema
8
10
  class AnchorType < Lutaml::Model::Serializable
@@ -20,21 +22,21 @@ module Metaschema
20
22
  attribute :img, ImageType, collection: true
21
23
 
22
24
  xml do
23
- root "anchorType"
24
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
25
+ root 'anchorType', mixed: true
26
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
25
27
 
26
28
  map_content to: :content
27
- map_attribute "href", to: :href
28
- map_attribute "title", to: :title
29
- map_element "code", to: :code
30
- map_element "em", to: :em
31
- map_element "i", to: :i
32
- map_element "b", to: :b
33
- map_element "strong", to: :strong
34
- map_element "sub", to: :sub
35
- map_element "sup", to: :sup
36
- map_element "q", to: :q
37
- map_element "img", to: :img
29
+ map_attribute 'href', to: :href
30
+ map_attribute 'title', to: :title
31
+ map_element 'code', to: :code
32
+ map_element 'em', to: :em
33
+ map_element 'i', to: :i
34
+ map_element 'b', to: :b
35
+ map_element 'strong', to: :strong
36
+ map_element 'sub', to: :sub
37
+ map_element 'sup', to: :sup
38
+ map_element 'q', to: :q
39
+ map_element 'img', to: :img
38
40
  end
39
41
  end
40
42
  end
@@ -1,10 +1,12 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
+
3
+ require 'lutaml/model'
2
4
 
3
5
  module Metaschema
4
6
  class AnyType < Lutaml::Model::Serializable
5
7
  xml do
6
- root "AnyType"
7
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
8
+ root 'AnyType'
9
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
8
10
  end
9
11
  end
10
12
  end
@@ -1,14 +1,16 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "constraint_let_type"
4
- require_relative "remarks_type"
5
- require_relative "targeted_allowed_values_constraint_type"
6
- require_relative "targeted_expect_constraint_type"
7
- require_relative "targeted_has_cardinality_constraint_type"
8
- require_relative "targeted_index_constraint_type"
9
- require_relative "targeted_index_has_key_constraint_type"
10
- require_relative "targeted_key_constraint_type"
11
- require_relative "targeted_matches_constraint_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'constraint_let_type'
6
+ require_relative 'remarks_type'
7
+ require_relative 'targeted_allowed_values_constraint_type'
8
+ require_relative 'targeted_expect_constraint_type'
9
+ require_relative 'targeted_has_cardinality_constraint_type'
10
+ require_relative 'targeted_index_constraint_type'
11
+ require_relative 'targeted_index_has_key_constraint_type'
12
+ require_relative 'targeted_key_constraint_type'
13
+ require_relative 'targeted_matches_constraint_type'
12
14
 
13
15
  module Metaschema
14
16
  class Assembly < Lutaml::Model::Serializable
@@ -24,19 +26,19 @@ module Metaschema
24
26
  attribute :remarks, RemarksType
25
27
 
26
28
  xml do
27
- root "assembly"
28
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
29
+ root 'assembly'
30
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
29
31
 
30
- map_attribute "target", to: :target
31
- map_element "let", to: :let
32
- map_element "allowed-values", to: :allowed_values
33
- map_element "matches", to: :matches
34
- map_element "index-has-key", to: :index_has_key
35
- map_element "expect", to: :expect
36
- map_element "index", to: :index
37
- map_element "is-unique", to: :is_unique
38
- map_element "has-cardinality", to: :has_cardinality
39
- map_element "remarks", to: :remarks
32
+ map_attribute 'target', to: :target
33
+ map_element 'let', to: :let
34
+ map_element 'is-unique', to: :is_unique
35
+ map_element 'allowed-values', to: :allowed_values
36
+ map_element 'matches', to: :matches
37
+ map_element 'index-has-key', to: :index_has_key
38
+ map_element 'expect', to: :expect
39
+ map_element 'index', to: :index
40
+ map_element 'has-cardinality', to: :has_cardinality
41
+ map_element 'remarks', to: :remarks
40
42
  end
41
43
  end
42
44
  end
@@ -1,12 +1,14 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "any_type"
4
- require_relative "assembly_reference_type"
5
- require_relative "choice_type"
6
- require_relative "field_reference_type"
7
- require_relative "grouped_choice_type"
8
- require_relative "inline_assembly_definition_type"
9
- require_relative "inline_field_definition_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'any_type'
6
+ require_relative 'assembly_reference_type'
7
+ require_relative 'choice_type'
8
+ require_relative 'field_reference_type'
9
+ require_relative 'grouped_choice_type'
10
+ require_relative 'inline_assembly_definition_type'
11
+ require_relative 'inline_field_definition_type'
10
12
 
11
13
  module Metaschema
12
14
  class AssemblyModelType < Lutaml::Model::Serializable
@@ -19,16 +21,16 @@ module Metaschema
19
21
  attribute :any, AnyType
20
22
 
21
23
  xml do
22
- root "AssemblyModelType"
23
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
24
+ root 'AssemblyModelType', ordered: true
25
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
24
26
 
25
- map_element "assembly", to: :assembly
26
- map_element "field", to: :field
27
- map_element "define-assembly", to: :define_assembly
28
- map_element "define-field", to: :define_field
29
- map_element "choice", to: :choice
30
- map_element "choice-group", to: :choice_group
31
- map_element "any", to: :any
27
+ map_element 'field', to: :field
28
+ map_element 'define-assembly', to: :define_assembly
29
+ map_element 'assembly', to: :assembly
30
+ map_element 'define-field', to: :define_field
31
+ map_element 'choice', to: :choice
32
+ map_element 'choice-group', to: :choice_group
33
+ map_element 'any', to: :any
32
34
  end
33
35
  end
34
36
  end
@@ -1,17 +1,19 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "group_as_type"
4
- require_relative "markup_line_datatype"
5
- require_relative "property_type"
6
- require_relative "remarks_type"
7
- require_relative "use_name_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'group_as_type'
6
+ require_relative 'markup_line_datatype'
7
+ require_relative 'property_type'
8
+ require_relative 'remarks_type'
9
+ require_relative 'use_name_type'
8
10
 
9
11
  module Metaschema
10
12
  class AssemblyReferenceType < Lutaml::Model::Serializable
11
13
  attribute :ref, :string
12
14
  attribute :index, :integer
13
- attribute :min_occurs, :integer, default: -> { "0" }
14
- attribute :max_occurs, :string, default: -> { "1" }
15
+ attribute :min_occurs, :integer, default: -> { '0' }
16
+ attribute :max_occurs, :string, default: -> { '1' }
15
17
  attribute :deprecated, :string
16
18
  attribute :formal_name, :string
17
19
  attribute :description, MarkupLineDatatype
@@ -21,20 +23,20 @@ module Metaschema
21
23
  attribute :remarks, RemarksType
22
24
 
23
25
  xml do
24
- root "AssemblyReferenceType"
25
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
26
+ root 'AssemblyReferenceType'
27
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
26
28
 
27
- map_attribute "ref", to: :ref
28
- map_attribute "index", to: :index
29
- map_attribute "min-occurs", to: :min_occurs
30
- map_attribute "max-occurs", to: :max_occurs
31
- map_attribute "deprecated", to: :deprecated
32
- map_element "formal-name", to: :formal_name
33
- map_element "description", to: :description
34
- map_element "prop", to: :prop
35
- map_element "use-name", to: :use_name
36
- map_element "group-as", to: :group_as
37
- map_element "remarks", to: :remarks
29
+ map_attribute 'ref', to: :ref
30
+ map_attribute 'index', to: :index
31
+ map_attribute 'min-occurs', to: :min_occurs
32
+ map_attribute 'max-occurs', to: :max_occurs
33
+ map_attribute 'deprecated', to: :deprecated
34
+ map_element 'formal-name', to: :formal_name
35
+ map_element 'description', to: :description
36
+ map_element 'prop', to: :prop
37
+ map_element 'use-name', to: :use_name
38
+ map_element 'group-as', to: :group_as
39
+ map_element 'remarks', to: :remarks
38
40
  end
39
41
  end
40
42
  end
@@ -1,11 +1,13 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "image_type"
4
- require_relative "inline_markup_type"
5
- require_relative "list_type"
6
- require_relative "ordered_list_type"
7
- require_relative "preformatted_type"
8
- require_relative "table_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'image_type'
6
+ require_relative 'inline_markup_type'
7
+ require_relative 'list_type'
8
+ require_relative 'ordered_list_type'
9
+ require_relative 'preformatted_type'
10
+ require_relative 'table_type'
9
11
 
10
12
  module Metaschema
11
13
  class BlockQuoteType < Lutaml::Model::Serializable
@@ -25,23 +27,23 @@ module Metaschema
25
27
  attribute :img, ImageType, collection: true
26
28
 
27
29
  xml do
28
- root "blockQuoteType"
29
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
30
+ root 'blockQuoteType', mixed: true
31
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
30
32
 
31
- map_element "h1", to: :h1
32
- map_element "h2", to: :h2
33
- map_element "h3", to: :h3
34
- map_element "h4", to: :h4
35
- map_element "h5", to: :h5
36
- map_element "h6", to: :h6
37
- map_element "ul", to: :ul
38
- map_element "ol", to: :ol
39
- map_element "pre", to: :pre
40
- map_element "hr", to: :hr
41
- map_element "blockquote", to: :blockquote
42
- map_element "p", to: :p
43
- map_element "table", to: :table
44
- map_element "img", to: :img
33
+ map_element 'h1', to: :h1
34
+ map_element 'h2', to: :h2
35
+ map_element 'h3', to: :h3
36
+ map_element 'h4', to: :h4
37
+ map_element 'h5', to: :h5
38
+ map_element 'h6', to: :h6
39
+ map_element 'ul', to: :ul
40
+ map_element 'ol', to: :ol
41
+ map_element 'pre', to: :pre
42
+ map_element 'hr', to: :hr
43
+ map_element 'blockquote', to: :blockquote
44
+ map_element 'p', to: :p
45
+ map_element 'table', to: :table
46
+ map_element 'img', to: :img
45
47
  end
46
48
  end
47
49
  end
@@ -1,9 +1,11 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "assembly_reference_type"
4
- require_relative "field_reference_type"
5
- require_relative "inline_assembly_definition_type"
6
- require_relative "inline_field_definition_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'assembly_reference_type'
6
+ require_relative 'field_reference_type'
7
+ require_relative 'inline_assembly_definition_type'
8
+ require_relative 'inline_field_definition_type'
7
9
 
8
10
  module Metaschema
9
11
  class ChoiceType < Lutaml::Model::Serializable
@@ -13,13 +15,13 @@ module Metaschema
13
15
  attribute :define_field, InlineFieldDefinitionType, collection: true
14
16
 
15
17
  xml do
16
- root "ChoiceType"
17
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
18
+ root 'ChoiceType'
19
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
18
20
 
19
- map_element "assembly", to: :assembly
20
- map_element "field", to: :field
21
- map_element "define-assembly", to: :define_assembly
22
- map_element "define-field", to: :define_field
21
+ map_element 'field', to: :field
22
+ map_element 'define-assembly', to: :define_assembly
23
+ map_element 'assembly', to: :assembly
24
+ map_element 'define-field', to: :define_field
23
25
  end
24
26
  end
25
27
  end
@@ -1,14 +1,16 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "anchor_type"
4
- require_relative "image_type"
5
- require_relative "inline_markup_type"
6
- require_relative "insert_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'anchor_type'
6
+ require_relative 'image_type'
7
+ require_relative 'inline_markup_type'
8
+ require_relative 'insert_type'
7
9
 
8
10
  module Metaschema
9
11
  class CodeType < Lutaml::Model::Serializable
10
12
  attribute :content, :string
11
- attribute :class, :string
13
+ attribute :klass, :string
12
14
  attribute :a, AnchorType, collection: true
13
15
  attribute :insert, InsertType, collection: true
14
16
  attribute :br, :string, collection: true
@@ -23,23 +25,23 @@ module Metaschema
23
25
  attribute :img, ImageType, collection: true
24
26
 
25
27
  xml do
26
- root "codeType"
27
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
28
+ root 'codeType', mixed: true
29
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
28
30
 
29
31
  map_content to: :content
30
- map_attribute "class", to: :class
31
- map_element "a", to: :a
32
- map_element "insert", to: :insert
33
- map_element "br", to: :br
34
- map_element "code", to: :code
35
- map_element "em", to: :em
36
- map_element "i", to: :i
37
- map_element "b", to: :b
38
- map_element "strong", to: :strong
39
- map_element "sub", to: :sub
40
- map_element "sup", to: :sup
41
- map_element "q", to: :q
42
- map_element "img", to: :img
32
+ map_attribute 'class', to: :klass
33
+ map_element 'a', to: :a
34
+ map_element 'insert', to: :insert
35
+ map_element 'br', to: :br
36
+ map_element 'code', to: :code
37
+ map_element 'em', to: :em
38
+ map_element 'i', to: :i
39
+ map_element 'b', to: :b
40
+ map_element 'strong', to: :strong
41
+ map_element 'sub', to: :sub
42
+ map_element 'sup', to: :sup
43
+ map_element 'q', to: :q
44
+ map_element 'img', to: :img
43
45
  end
44
46
  end
45
47
  end
@@ -1,6 +1,8 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "remarks_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'remarks_type'
4
6
 
5
7
  module Metaschema
6
8
  class ConstraintLetType < Lutaml::Model::Serializable
@@ -9,12 +11,12 @@ module Metaschema
9
11
  attribute :remarks, RemarksType
10
12
 
11
13
  xml do
12
- root "ConstraintLetType"
13
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
14
+ root 'ConstraintLetType'
15
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
14
16
 
15
- map_attribute "var", to: :var
16
- map_attribute "expression", to: :expression
17
- map_element "remarks", to: :remarks
17
+ map_attribute 'var', to: :var
18
+ map_attribute 'expression', to: :expression
19
+ map_element 'remarks', to: :remarks
18
20
  end
19
21
  end
20
22
  end