metaschema 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec_status +64 -0
  3. data/.rubocop.yml +1 -0
  4. data/.rubocop_todo.yml +76 -0
  5. data/Rakefile +3 -3
  6. data/exe/metaschema +2 -2
  7. data/lib/metaschema/allowed_value_type.rb +24 -22
  8. data/lib/metaschema/allowed_values_type.rb +21 -19
  9. data/lib/metaschema/anchor_type.rb +19 -17
  10. data/lib/metaschema/any_type.rb +5 -3
  11. data/lib/metaschema/assembly.rb +24 -22
  12. data/lib/metaschema/assembly_model_type.rb +19 -17
  13. data/lib/metaschema/assembly_reference_type.rb +23 -21
  14. data/lib/metaschema/block_quote_type.rb +25 -23
  15. data/lib/metaschema/choice_type.rb +13 -11
  16. data/lib/metaschema/code_type.rb +23 -21
  17. data/lib/metaschema/constraint_let_type.rb +9 -7
  18. data/lib/metaschema/define_assembly_constraints_type.rb +23 -21
  19. data/lib/metaschema/define_field_constraints_type.rb +17 -15
  20. data/lib/metaschema/define_flag_constraints_type.rb +17 -15
  21. data/lib/metaschema/example_type.rb +11 -9
  22. data/lib/metaschema/expect_constraint_type.rb +17 -15
  23. data/lib/metaschema/field.rb +18 -16
  24. data/lib/metaschema/field_reference_type.rb +26 -24
  25. data/lib/metaschema/flag.rb +18 -16
  26. data/lib/metaschema/flag_reference_type.rb +20 -18
  27. data/lib/metaschema/global_assembly_definition_type.rb +33 -31
  28. data/lib/metaschema/global_field_definition_type.rb +37 -33
  29. data/lib/metaschema/global_flag_definition_type.rb +26 -24
  30. data/lib/metaschema/group_as_type.rb +10 -8
  31. data/lib/metaschema/grouped_assembly_reference_type.rb +17 -15
  32. data/lib/metaschema/grouped_choice_type.rb +23 -21
  33. data/lib/metaschema/grouped_field_reference_type.rb +17 -15
  34. data/lib/metaschema/grouped_inline_assembly_definition_type.rb +28 -26
  35. data/lib/metaschema/grouped_inline_field_definition_type.rb +35 -33
  36. data/lib/metaschema/image_type.rb +8 -6
  37. data/lib/metaschema/import.rb +6 -4
  38. data/lib/metaschema/index_has_key_constraint_type.rb +18 -16
  39. data/lib/metaschema/inline_assembly_definition_type.rb +35 -33
  40. data/lib/metaschema/inline_field_definition_type.rb +41 -39
  41. data/lib/metaschema/inline_flag_definition_type.rb +24 -22
  42. data/lib/metaschema/inline_markup_type.rb +19 -17
  43. data/lib/metaschema/insert_type.rb +7 -5
  44. data/lib/metaschema/json_key_type.rb +6 -4
  45. data/lib/metaschema/json_value_key_flag_type.rb +6 -4
  46. data/lib/metaschema/key_field.rb +9 -7
  47. data/lib/metaschema/list_item_type.rb +36 -34
  48. data/lib/metaschema/list_type.rb +7 -5
  49. data/lib/metaschema/markup_line_datatype.rb +22 -20
  50. data/lib/metaschema/matches_constraint_type.rb +17 -15
  51. data/lib/metaschema/metaschema_import_type.rb +6 -4
  52. data/lib/metaschema/metaschemaconstraints.rb +15 -13
  53. data/lib/metaschema/namespace_binding_type.rb +7 -5
  54. data/lib/metaschema/ordered_list_type.rb +7 -5
  55. data/lib/metaschema/preformatted_type.rb +22 -20
  56. data/lib/metaschema/property_type.rb +9 -7
  57. data/lib/metaschema/remarks_type.rb +28 -26
  58. data/lib/metaschema/root.rb +27 -25
  59. data/lib/metaschema/root_name.rb +6 -4
  60. data/lib/metaschema/scope.rb +13 -11
  61. data/lib/metaschema/table_cell_type.rb +24 -22
  62. data/lib/metaschema/table_row_type.rb +8 -6
  63. data/lib/metaschema/table_type.rb +7 -5
  64. data/lib/metaschema/targeted_allowed_values_constraint_type.rb +22 -20
  65. data/lib/metaschema/targeted_expect_constraint_type.rb +18 -16
  66. data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +18 -16
  67. data/lib/metaschema/targeted_index_constraint_type.rb +19 -17
  68. data/lib/metaschema/targeted_index_has_key_constraint_type.rb +19 -17
  69. data/lib/metaschema/targeted_key_constraint_type.rb +18 -16
  70. data/lib/metaschema/targeted_matches_constraint_type.rb +18 -16
  71. data/lib/metaschema/use_name_type.rb +6 -4
  72. data/lib/metaschema/version.rb +1 -1
  73. data/lib/metaschema.rb +4 -4
  74. metadata +9 -6
@@ -1,9 +1,11 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "import"
4
- require_relative "namespace_binding_type"
5
- require_relative "remarks_type"
6
- require_relative "scope"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'import'
6
+ require_relative 'namespace_binding_type'
7
+ require_relative 'remarks_type'
8
+ require_relative 'scope'
7
9
 
8
10
  module Metaschema
9
11
  class METASCHEMACONSTRAINTS < Lutaml::Model::Serializable
@@ -15,15 +17,15 @@ module Metaschema
15
17
  attribute :remarks, RemarksType
16
18
 
17
19
  xml do
18
- root "METASCHEMA-CONSTRAINTS"
19
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
20
+ root 'METASCHEMA-CONSTRAINTS'
21
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
20
22
 
21
- map_element "name", to: :name
22
- map_element "version", to: :version
23
- map_element "import", to: :import
24
- map_element "namespace-binding", to: :namespace_binding
25
- map_element "scope", to: :scope
26
- map_element "remarks", to: :remarks
23
+ map_element 'name', to: :name
24
+ map_element 'version', to: :version
25
+ map_element 'import', to: :import
26
+ map_element 'namespace-binding', to: :namespace_binding
27
+ map_element 'scope', to: :scope
28
+ map_element 'remarks', to: :remarks
27
29
  end
28
30
  end
29
31
  end
@@ -1,4 +1,6 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
+
3
+ require 'lutaml/model'
2
4
 
3
5
  module Metaschema
4
6
  class NamespaceBindingType < Lutaml::Model::Serializable
@@ -6,11 +8,11 @@ module Metaschema
6
8
  attribute :uri, :string
7
9
 
8
10
  xml do
9
- root "NamespaceBindingType"
10
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
11
+ root 'NamespaceBindingType'
12
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
11
13
 
12
- map_attribute "prefix", to: :prefix
13
- map_attribute "uri", to: :uri
14
+ map_attribute 'prefix', to: :prefix
15
+ map_attribute 'uri', to: :uri
14
16
  end
15
17
  end
16
18
  end
@@ -1,4 +1,6 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
+
3
+ require 'lutaml/model'
2
4
 
3
5
  # require_relative "list_item_type"
4
6
 
@@ -10,11 +12,11 @@ module Metaschema
10
12
  attribute :li, ListItemType, collection: true
11
13
 
12
14
  xml do
13
- root "orderedListType"
14
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
15
+ root 'orderedListType'
16
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
15
17
 
16
- map_attribute "start", to: :start
17
- map_element "li", to: :li
18
+ map_attribute 'start', to: :start
19
+ map_element 'li', to: :li
18
20
  end
19
21
  end
20
22
  end
@@ -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 PreformattedType < Lutaml::Model::Serializable
@@ -23,22 +25,22 @@ module Metaschema
23
25
  attribute :img, ImageType, collection: true
24
26
 
25
27
  xml do
26
- root "preformattedType"
27
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
28
+ root 'preformattedType', mixed: true
29
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
28
30
 
29
31
  map_content to: :content
30
- map_element "a", to: :a
31
- map_element "insert", to: :insert
32
- map_element "br", to: :br
33
- map_element "code", to: :code
34
- map_element "em", to: :em
35
- map_element "i", to: :i
36
- map_element "b", to: :b
37
- map_element "strong", to: :strong
38
- map_element "sub", to: :sub
39
- map_element "sup", to: :sup
40
- map_element "q", to: :q
41
- map_element "img", to: :img
32
+ map_element 'a', to: :a
33
+ map_element 'insert', to: :insert
34
+ map_element 'br', to: :br
35
+ map_element 'code', to: :code
36
+ map_element 'em', to: :em
37
+ map_element 'i', to: :i
38
+ map_element 'b', to: :b
39
+ map_element 'strong', to: :strong
40
+ map_element 'sub', to: :sub
41
+ map_element 'sup', to: :sup
42
+ map_element 'q', to: :q
43
+ map_element 'img', to: :img
42
44
  end
43
45
  end
44
46
  end
@@ -1,18 +1,20 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
+
3
+ require 'lutaml/model'
2
4
 
3
5
  module Metaschema
4
6
  class PropertyType < Lutaml::Model::Serializable
5
- attribute :namespace, :string, default: -> { "http://csrc.nist.gov/ns/oscal/metaschema/1.0" }
7
+ attribute :namespace, :string, default: -> { 'http://csrc.nist.gov/ns/oscal/metaschema/1.0' }
6
8
  attribute :name, :string
7
9
  attribute :value, :string
8
10
 
9
11
  xml do
10
- root "PropertyType"
11
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
12
+ root 'PropertyType'
13
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
12
14
 
13
- map_attribute "namespace", to: :namespace
14
- map_attribute "name", to: :name
15
- map_attribute "value", to: :value
15
+ map_attribute 'namespace', to: :namespace
16
+ map_attribute 'name', to: :name
17
+ map_attribute 'value', to: :value
16
18
  end
17
19
  end
18
20
  end
@@ -1,16 +1,18 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "block_quote_type"
4
- require_relative "image_type"
5
- require_relative "inline_markup_type"
6
- require_relative "list_type"
7
- require_relative "ordered_list_type"
8
- require_relative "preformatted_type"
9
- require_relative "table_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'block_quote_type'
6
+ require_relative 'image_type'
7
+ require_relative 'inline_markup_type'
8
+ require_relative 'list_type'
9
+ require_relative 'ordered_list_type'
10
+ require_relative 'preformatted_type'
11
+ require_relative 'table_type'
10
12
 
11
13
  module Metaschema
12
14
  class RemarksType < Lutaml::Model::Serializable
13
- attribute :class, :string
15
+ attribute :klass, :string
14
16
  attribute :h1, InlineMarkupType, collection: true
15
17
  attribute :h2, InlineMarkupType, collection: true
16
18
  attribute :h3, InlineMarkupType, collection: true
@@ -27,24 +29,24 @@ module Metaschema
27
29
  attribute :img, ImageType, collection: true
28
30
 
29
31
  xml do
30
- root "RemarksType"
31
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
32
+ root 'RemarksType', mixed: true
33
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
32
34
 
33
- map_attribute "class", to: :class
34
- map_element "h1", to: :h1
35
- map_element "h2", to: :h2
36
- map_element "h3", to: :h3
37
- map_element "h4", to: :h4
38
- map_element "h5", to: :h5
39
- map_element "h6", to: :h6
40
- map_element "ul", to: :ul
41
- map_element "ol", to: :ol
42
- map_element "pre", to: :pre
43
- map_element "hr", to: :hr
44
- map_element "blockquote", to: :blockquote
45
- map_element "p", to: :p
46
- map_element "table", to: :table
47
- map_element "img", to: :img
35
+ map_attribute 'class', to: :klass
36
+ map_element 'h1', to: :h1
37
+ map_element 'h2', to: :h2
38
+ map_element 'h3', to: :h3
39
+ map_element 'h4', to: :h4
40
+ map_element 'h5', to: :h5
41
+ map_element 'h6', to: :h6
42
+ map_element 'ul', to: :ul
43
+ map_element 'ol', to: :ol
44
+ map_element 'pre', to: :pre
45
+ map_element 'hr', to: :hr
46
+ map_element 'blockquote', to: :blockquote
47
+ map_element 'p', to: :p
48
+ map_element 'table', to: :table
49
+ map_element 'img', to: :img
48
50
  end
49
51
  end
50
52
  end
@@ -1,17 +1,19 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "global_assembly_definition_type"
4
- require_relative "global_field_definition_type"
5
- require_relative "global_flag_definition_type"
6
- require_relative "markup_line_datatype"
7
- require_relative "metaschema_import_type"
8
- require_relative "namespace_binding_type"
9
- require_relative "property_type"
10
- require_relative "remarks_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'global_assembly_definition_type'
6
+ require_relative 'global_field_definition_type'
7
+ require_relative 'global_flag_definition_type'
8
+ require_relative 'markup_line_datatype'
9
+ require_relative 'metaschema_import_type'
10
+ require_relative 'namespace_binding_type'
11
+ require_relative 'property_type'
12
+ require_relative 'remarks_type'
11
13
 
12
14
  module Metaschema
13
15
  class Root < Lutaml::Model::Serializable
14
- attribute :abstract, :string, default: -> { "no" }
16
+ attribute :abstract, :string, default: -> { 'no' }
15
17
  attribute :schema_name, MarkupLineDatatype
16
18
  attribute :schema_version, :string
17
19
  attribute :short_name, :string
@@ -26,22 +28,22 @@ module Metaschema
26
28
  attribute :define_flag, GlobalFlagDefinitionType, collection: true
27
29
 
28
30
  xml do
29
- root "METASCHEMA"
30
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
31
+ root 'METASCHEMA', ordered: true
32
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
31
33
 
32
- map_attribute "abstract", to: :abstract
33
- map_element "schema-name", to: :schema_name
34
- map_element "schema-version", to: :schema_version
35
- map_element "short-name", to: :short_name
36
- map_element "namespace", to: :namespace
37
- map_element "json-base-uri", to: :json_base_uri
38
- map_element "prop", to: :prop
39
- map_element "remarks", to: :remarks
40
- map_element "import", to: :import
41
- map_element "namespace-binding", to: :namespace_binding
42
- map_element "define-assembly", to: :define_assembly
43
- map_element "define-field", to: :define_field
44
- map_element "define-flag", to: :define_flag
34
+ map_attribute 'abstract', to: :abstract
35
+ map_element 'schema-name', to: :schema_name
36
+ map_element 'schema-version', to: :schema_version
37
+ map_element 'short-name', to: :short_name
38
+ map_element 'namespace', to: :namespace
39
+ map_element 'json-base-uri', to: :json_base_uri
40
+ map_element 'prop', to: :prop
41
+ map_element 'remarks', to: :remarks
42
+ map_element 'import', to: :import
43
+ map_element 'namespace-binding', to: :namespace_binding
44
+ map_element 'define-assembly', to: :define_assembly
45
+ map_element 'define-field', to: :define_field
46
+ map_element 'define-flag', to: :define_flag
45
47
  end
46
48
  end
47
49
  end
@@ -1,4 +1,6 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
+
3
+ require 'lutaml/model'
2
4
 
3
5
  module Metaschema
4
6
  class RootName < Lutaml::Model::Serializable
@@ -6,11 +8,11 @@ module Metaschema
6
8
  attribute :index, :integer
7
9
 
8
10
  xml do
9
- root "root-name"
10
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
11
+ root 'root-name'
12
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
11
13
 
12
14
  map_content to: :content
13
- map_attribute "index", to: :index
15
+ map_attribute 'index', to: :index
14
16
  end
15
17
  end
16
18
  end
@@ -1,8 +1,10 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "assembly"
4
- require_relative "field"
5
- require_relative "flag"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'assembly'
6
+ require_relative 'field'
7
+ require_relative 'flag'
6
8
 
7
9
  module Metaschema
8
10
  class Scope < Lutaml::Model::Serializable
@@ -13,14 +15,14 @@ module Metaschema
13
15
  attribute :flag, Flag, collection: true
14
16
 
15
17
  xml do
16
- root "scope"
17
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
18
+ root 'scope'
19
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
18
20
 
19
- map_attribute "metaschema-namespace", to: :metaschema_namespace
20
- map_attribute "metaschema-short-name", to: :metaschema_short_name
21
- map_element "assembly", to: :assembly
22
- map_element "field", to: :field
23
- map_element "flag", to: :flag
21
+ map_attribute 'metaschema-namespace', to: :metaschema_namespace
22
+ map_attribute 'metaschema-short-name', to: :metaschema_short_name
23
+ map_element 'field', to: :field
24
+ map_element 'assembly', to: :assembly
25
+ map_element 'flag', to: :flag
24
26
  end
25
27
  end
26
28
  end
@@ -1,15 +1,17 @@
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 TableCellType < Lutaml::Model::Serializable
11
13
  attribute :content, :string
12
- attribute :align, :string, default: -> { "left" }
14
+ attribute :align, :string, default: -> { 'left' }
13
15
  attribute :a, AnchorType, collection: true
14
16
  attribute :insert, InsertType, collection: true
15
17
  attribute :br, :string, collection: true
@@ -24,23 +26,23 @@ module Metaschema
24
26
  attribute :img, ImageType, collection: true
25
27
 
26
28
  xml do
27
- root "tableCellType"
28
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
29
+ root 'tableCellType', mixed: true
30
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
29
31
 
30
32
  map_content to: :content
31
- map_attribute "align", to: :align
32
- map_element "a", to: :a
33
- map_element "insert", to: :insert
34
- map_element "br", to: :br
35
- map_element "code", to: :code
36
- map_element "em", to: :em
37
- map_element "i", to: :i
38
- map_element "b", to: :b
39
- map_element "strong", to: :strong
40
- map_element "sub", to: :sub
41
- map_element "sup", to: :sup
42
- map_element "q", to: :q
43
- map_element "img", to: :img
33
+ map_attribute 'align', to: :align
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
44
46
  end
45
47
  end
46
48
  end
@@ -1,6 +1,8 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "table_cell_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'table_cell_type'
4
6
 
5
7
  module Metaschema
6
8
  class TableRowType < Lutaml::Model::Serializable
@@ -8,11 +10,11 @@ module Metaschema
8
10
  attribute :th, TableCellType, collection: true
9
11
 
10
12
  xml do
11
- root "tableRowType"
12
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
13
+ root 'tableRowType'
14
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
13
15
 
14
- map_element "td", to: :td
15
- map_element "th", to: :th
16
+ map_element 'td', to: :td
17
+ map_element 'th', to: :th
16
18
  end
17
19
  end
18
20
  end
@@ -1,16 +1,18 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "table_row_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'table_row_type'
4
6
 
5
7
  module Metaschema
6
8
  class TableType < Lutaml::Model::Serializable
7
9
  attribute :tr, TableRowType, collection: true
8
10
 
9
11
  xml do
10
- root "tableType"
11
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
12
+ root 'tableType'
13
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
12
14
 
13
- map_element "tr", to: :tr
15
+ map_element 'tr', to: :tr
14
16
  end
15
17
  end
16
18
  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 TargetedAllowedValuesConstraintType < 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 :target, :string
15
17
  attribute :formal_name, :string
16
18
  attribute :description, MarkupLineDatatype
@@ -19,19 +21,19 @@ module Metaschema
19
21
  attribute :remarks, RemarksType
20
22
 
21
23
  xml do
22
- root "TargetedAllowedValuesConstraintType"
23
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
24
+ root 'TargetedAllowedValuesConstraintType'
25
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
24
26
 
25
- map_attribute "id", to: :id
26
- map_attribute "level", to: :level
27
- map_attribute "allow-other", to: :allow_other
28
- map_attribute "extensible", to: :extensible
29
- map_attribute "target", to: :target
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
27
+ map_attribute 'id', to: :id
28
+ map_attribute 'level', to: :level
29
+ map_attribute 'allow-other', to: :allow_other
30
+ map_attribute 'extensible', to: :extensible
31
+ map_attribute 'target', to: :target
32
+ map_element 'formal-name', to: :formal_name
33
+ map_element 'description', to: :description
34
+ map_element 'prop', to: :prop
35
+ map_element 'enum', to: :enum
36
+ map_element 'remarks', to: :remarks
35
37
  end
36
38
  end
37
39
  end
@@ -1,13 +1,15 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "markup_line_datatype"
4
- require_relative "property_type"
5
- require_relative "remarks_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'markup_line_datatype'
6
+ require_relative 'property_type'
7
+ require_relative 'remarks_type'
6
8
 
7
9
  module Metaschema
8
10
  class TargetedExpectConstraintType < Lutaml::Model::Serializable
9
11
  attribute :id, :string
10
- attribute :level, :string, default: -> { "ERROR" }
12
+ attribute :level, :string, default: -> { 'ERROR' }
11
13
  attribute :test, :string
12
14
  attribute :target, :string
13
15
  attribute :formal_name, :string
@@ -17,18 +19,18 @@ module Metaschema
17
19
  attribute :remarks, RemarksType
18
20
 
19
21
  xml do
20
- root "TargetedExpectConstraintType"
21
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
22
+ root 'TargetedExpectConstraintType'
23
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
22
24
 
23
- map_attribute "id", to: :id
24
- map_attribute "level", to: :level
25
- map_attribute "test", to: :test
26
- map_attribute "target", to: :target
27
- map_element "formal-name", to: :formal_name
28
- map_element "description", to: :description
29
- map_element "prop", to: :prop
30
- map_element "message", to: :message
31
- map_element "remarks", to: :remarks
25
+ map_attribute 'id', to: :id
26
+ map_attribute 'level', to: :level
27
+ map_attribute 'test', to: :test
28
+ map_attribute 'target', to: :target
29
+ map_element 'formal-name', to: :formal_name
30
+ map_element 'description', to: :description
31
+ map_element 'prop', to: :prop
32
+ map_element 'message', to: :message
33
+ map_element 'remarks', to: :remarks
32
34
  end
33
35
  end
34
36
  end