Class: Lutaml::Model::Schema::Generator::Property
- Inherits:
-
Object
- Object
- Lutaml::Model::Schema::Generator::Property
- Defined in:
- lib/lutaml/model/schema/generator/property.rb
Overview
This class is used to generate a property schema definition. It is used in the context of generating JSON schemas.
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#register ⇒ Object
readonly
Returns the value of attribute register.
Instance Method Summary collapse
-
#initialize(name, attribute, register:) ⇒ Property
constructor
A new instance of Property.
- #to_schema ⇒ Object
Constructor Details
#initialize(name, attribute, register:) ⇒ Property
Returns a new instance of Property.
10 11 12 13 14 |
# File 'lib/lutaml/model/schema/generator/property.rb', line 10 def initialize(name, attribute, register:) @name = name.to_s.gsub("::", "_") @attribute = attribute @register = register end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
8 9 10 |
# File 'lib/lutaml/model/schema/generator/property.rb', line 8 def attribute @attribute end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/lutaml/model/schema/generator/property.rb', line 8 def name @name end |
#register ⇒ Object (readonly)
Returns the value of attribute register.
8 9 10 |
# File 'lib/lutaml/model/schema/generator/property.rb', line 8 def register @register end |
Instance Method Details
#to_schema ⇒ Object
16 17 18 |
# File 'lib/lutaml/model/schema/generator/property.rb', line 16 def to_schema { name => generate_attribute_schema(attribute) } end |