Module: Lutaml::Model
- Defined in:
- lib/lutaml/model.rb,
lib/lutaml/model/cli.rb,
lib/lutaml/model/xml.rb,
lib/lutaml/model/json.rb,
lib/lutaml/model/toml.rb,
lib/lutaml/model/type.rb,
lib/lutaml/model/yaml.rb,
lib/lutaml/model/error.rb,
lib/lutaml/model/jsonl.rb,
lib/lutaml/model/utils.rb,
lib/lutaml/model/yamls.rb,
lib/lutaml/model/choice.rb,
lib/lutaml/model/config.rb,
lib/lutaml/model/errors.rb,
lib/lutaml/model/schema.rb,
lib/lutaml/model/version.rb,
lib/lutaml/model/register.rb,
lib/lutaml/model/sequence.rb,
lib/lutaml/model/attribute.rb,
lib/lutaml/model/constants.rb,
lib/lutaml/model/serialize.rb,
lib/lutaml/model/transform.rb,
lib/lutaml/model/type/date.rb,
lib/lutaml/model/type/hash.rb,
lib/lutaml/model/type/time.rb,
lib/lutaml/model/collection.rb,
lib/lutaml/model/comparison.rb,
lib/lutaml/model/type/float.rb,
lib/lutaml/model/type/value.rb,
lib/lutaml/model/validation.rb,
lib/lutaml/model/liquefiable.rb,
lib/lutaml/model/registrable.rb,
lib/lutaml/model/type/string.rb,
lib/lutaml/model/xml/element.rb,
lib/lutaml/model/xml/mapping.rb,
lib/lutaml/model/xml_adapter.rb,
lib/lutaml/model/hash_adapter.rb,
lib/lutaml/model/json/mapping.rb,
lib/lutaml/model/json_adapter.rb,
lib/lutaml/model/mapping_hash.rb,
lib/lutaml/model/serializable.rb,
lib/lutaml/model/toml/mapping.rb,
lib/lutaml/model/type/boolean.rb,
lib/lutaml/model/type/decimal.rb,
lib/lutaml/model/type/integer.rb,
lib/lutaml/model/xml/document.rb,
lib/lutaml/model/yaml/mapping.rb,
lib/lutaml/model/json/document.rb,
lib/lutaml/model/jsonl/mapping.rb,
lib/lutaml/model/services/base.rb,
lib/lutaml/model/toml/document.rb,
lib/lutaml/model/xml/transform.rb,
lib/lutaml/model/yaml/document.rb,
lib/lutaml/model/yamls/mapping.rb,
lib/lutaml/model/comparable_nil.rb,
lib/lutaml/model/json/transform.rb,
lib/lutaml/model/jsonl/document.rb,
lib/lutaml/model/toml/transform.rb,
lib/lutaml/model/type/date_time.rb,
lib/lutaml/model/xml/builder/ox.rb,
lib/lutaml/model/xml/ox_adapter.rb,
lib/lutaml/model/yaml/transform.rb,
lib/lutaml/model/yamls/document.rb,
lib/lutaml/model/format_registry.rb,
lib/lutaml/model/global_register.rb,
lib/lutaml/model/jsonl/transform.rb,
lib/lutaml/model/mapping/mapping.rb,
lib/lutaml/model/schema/renderer.rb,
lib/lutaml/model/schema_location.rb,
lib/lutaml/model/services/logger.rb,
lib/lutaml/model/xml/builder/oga.rb,
lib/lutaml/model/xml/oga/element.rb,
lib/lutaml/model/xml/oga_adapter.rb,
lib/lutaml/model/xml/xml_element.rb,
lib/lutaml/model/yamls/transform.rb,
lib/lutaml/model/comparable_model.rb,
lib/lutaml/model/error/type_error.rb,
lib/lutaml/model/xml/mapping_rule.rb,
lib/lutaml/model/xml/oga/document.rb,
lib/lutaml/model/json/mapping_rule.rb,
lib/lutaml/model/schema/xsd_schema.rb,
lib/lutaml/model/toml/mapping_rule.rb,
lib/lutaml/model/xml/xml_attribute.rb,
lib/lutaml/model/xml/xml_namespace.rb,
lib/lutaml/model/yaml/mapping_rule.rb,
lib/lutaml/model/jsonl/mapping_rule.rb,
lib/lutaml/model/key_value_document.rb,
lib/lutaml/model/schema/base_schema.rb,
lib/lutaml/model/schema/json_schema.rb,
lib/lutaml/model/schema/yaml_schema.rb,
lib/lutaml/model/services/validator.rb,
lib/lutaml/model/yamls/mapping_rule.rb,
lib/lutaml/model/schema/xml_compiler.rb,
lib/lutaml/model/toml/tomlib_adapter.rb,
lib/lutaml/model/uninitialized_class.rb,
lib/lutaml/model/xml_adapter/element.rb,
lib/lutaml/model/hash_adapter/mapping.rb,
lib/lutaml/model/mapping/mapping_rule.rb,
lib/lutaml/model/schema/generator/ref.rb,
lib/lutaml/model/services/transformer.rb,
lib/lutaml/model/toml/toml_rb_adapter.rb,
lib/lutaml/model/xml/builder/nokogiri.rb,
lib/lutaml/model/xml/nokogiri_adapter.rb,
lib/lutaml/model/hash_adapter/document.rb,
lib/lutaml/model/json/standard_adapter.rb,
lib/lutaml/model/schema/relaxng_schema.rb,
lib/lutaml/model/schema/shared_methods.rb,
lib/lutaml/model/serialization_adapter.rb,
lib/lutaml/model/yaml/standard_adapter.rb,
lib/lutaml/model/error/validation_error.rb,
lib/lutaml/model/hash_adapter/transform.rb,
lib/lutaml/model/jsonl/standard_adapter.rb,
lib/lutaml/model/type/time_without_date.rb,
lib/lutaml/model/xml_adapter/ox_adapter.rb,
lib/lutaml/model/yamls/standard_adapter.rb,
lib/lutaml/model/error/polymorphic_error.rb,
lib/lutaml/model/json/multi_json_adapter.rb,
lib/lutaml/model/services/type/validator.rb,
lib/lutaml/model/transform/xml_transform.rb,
lib/lutaml/model/xml_adapter/oga_adapter.rb,
lib/lutaml/model/error/unknown_type_error.rb,
lib/lutaml/model/error/invalid_value_error.rb,
lib/lutaml/model/hash_adapter/mapping_rule.rb,
lib/lutaml/model/mapping/key_value_mapping.rb,
lib/lutaml/model/schema/decorators/choices.rb,
lib/lutaml/model/schema/generator/property.rb,
lib/lutaml/model/schema/json_schema_parser.rb,
lib/lutaml/model/schema/xml_compiler/group.rb,
lib/lutaml/model/error/type/max_bound_error.rb,
lib/lutaml/model/error/type/min_bound_error.rb,
lib/lutaml/model/schema/xml_compiler/choice.rb,
lib/lutaml/model/error/no_root_mapping_error.rb,
lib/lutaml/model/error/type/max_length_error.rb,
lib/lutaml/model/error/type/min_length_error.rb,
lib/lutaml/model/schema/decorators/attribute.rb,
lib/lutaml/model/schema/generator/definition.rb,
lib/lutaml/model/schema/xml_compiler/element.rb,
lib/lutaml/model/error/type_not_enabled_error.rb,
lib/lutaml/model/schema/xml_compiler/sequence.rb,
lib/lutaml/model/xml_adapter/nokogiri_adapter.rb,
lib/lutaml/model/error/multiple_mappings_error.rb,
lib/lutaml/model/error/no_root_namespace_error.rb,
lib/lutaml/model/error/validation_failed_error.rb,
lib/lutaml/model/hash_adapter/standard_adapter.rb,
lib/lutaml/model/schema/xml_compiler/attribute.rb,
lib/lutaml/model/services/rule_value_extractor.rb,
lib/lutaml/model/transform/key_value_transform.rb,
lib/lutaml/model/error/choice_lower_bound_error.rb,
lib/lutaml/model/error/choice_upper_bound_error.rb,
lib/lutaml/model/error/incorrect_sequence_error.rb,
lib/lutaml/model/error/liquid_not_enabled_error.rb,
lib/lutaml/model/error/type/invalid_value_error.rb,
lib/lutaml/model/mapping/key_value_mapping_rule.rb,
lib/lutaml/model/schema/helpers/template_helper.rb,
lib/lutaml/model/services/type/validator/number.rb,
lib/lutaml/model/services/type/validator/string.rb,
lib/lutaml/model/error/pattern_not_matched_error.rb,
lib/lutaml/model/schema/xml_compiler/restriction.rb,
lib/lutaml/model/schema/xml_compiler/simple_type.rb,
lib/lutaml/model/error/invalid_choice_range_error.rb,
lib/lutaml/model/error/unknown_adapter_type_error.rb,
lib/lutaml/model/schema/xml_compiler/complex_type.rb,
lib/lutaml/model/error/import_model_with_root_error.rb,
lib/lutaml/model/error/invalid_attribute_name_error.rb,
lib/lutaml/model/schema/decorators/class_definition.rb,
lib/lutaml/model/schema/xml_compiler/simple_content.rb,
lib/lutaml/model/error/collection_true_missing_error.rb,
lib/lutaml/model/schema/xml_compiler/attribute_group.rb,
lib/lutaml/model/schema/xml_compiler/complex_content.rb,
lib/lutaml/model/error/type/pattern_not_matched_error.rb,
lib/lutaml/model/error/unknown_sequence_mapping_error.rb,
lib/lutaml/model/error/invalid_attribute_options_error.rb,
lib/lutaml/model/error/element_count_out_of_range_error.rb,
lib/lutaml/model/error/incorrect_mapping_argument_error.rb,
lib/lutaml/model/schema/generator/properties_collection.rb,
lib/lutaml/model/schema/decorators/definition_collection.rb,
lib/lutaml/model/schema/generator/definitions_collection.rb,
lib/lutaml/model/error/collection_count_out_of_range_error.rb,
lib/lutaml/model/error/register/not_registrable_class_error.rb,
lib/lutaml/model/schema/xml_compiler/complex_content_restriction.rb
Defined Under Namespace
Modules: ComparableModel, Config, Constants, HashAdapter, Json, JsonAdapter, Jsonl, Liquefiable, Registrable, Schema, Serialize, Services, Toml, Type, Utils, Validation, Xml, XmlAdapter, Yaml, Yamls Classes: Attribute, BaseModel, Choice, ChoiceLowerBoundError, ChoiceUpperBoundError, Cli, Collection, CollectionCountOutOfRangeError, CollectionTrueMissingError, ComparableNil, Comparison, ElementCountOutOfRangeError, Error, Errors, ExportTransformer, FormatRegistry, GlobalRegister, ImportModelWithRootError, ImportTransformer, IncorrectMappingArgumentsError, IncorrectModelError, IncorrectSequenceError, InvalidAttributeNameError, InvalidAttributeOptionsError, InvalidChoiceRangeError, InvalidValueError, KeyValueDocument, KeyValueMapping, KeyValueMappingRule, KeyValueTransform, LiquidNotEnabledError, Location, Logger, Mapping, MappingHash, MappingRule, MultipleMappingsError, NoRootMappingError, NoRootNamespaceError, PatternNotMatchedError, PolymorphicError, Register, RuleValueExtractor, SchemaLocation, Sequence, Serializable, SerializationAdapter, Transform, Transformer, TypeError, TypeNotEnabledError, UninitializedClass, UnknownAdapterTypeError, UnknownSequenceMappingError, UnknownTypeError, ValidationError, ValidationFailedError, ValidationRule, Validator, XmlTransform
Constant Summary collapse
- VERSION =
"0.7.5"
Instance Method Summary collapse
-
#to_tree ⇒ String
Generates a tree representation of the object.
Instance Method Details
#to_tree ⇒ String
Generates a tree representation of the object
555 556 557 558 559 560 561 562 563 564 565 |
# File 'lib/lutaml/model/comparable_model.rb', line 555 def to_tree output = "#{self.class}\n" self.class.attributes.each_with_index do |(name, type), index| value = send(name) is_last = index == self.class.attributes.length - 1 context = DiffContext.new(nil, nil, show_unchanged: false) formatted = context.format_value(value) output << context.tree_line(is_last, "#{name} (#{type}): #{formatted}") end output end |