Class: Hyrax::Schema Private
- Inherits:
-
Module
- Object
- Module
- Hyrax::Schema
- Defined in:
- lib/hyrax/schema.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A module specifying a Schema (set of attributes and types) that can be applied to a ‘Valkyrie::Resource`. This provides the internals for the recommended module builder syntax: `Hyrax::Schema(:schema_name)`
Instance Attribute Summary collapse
- #name ⇒ Object readonly private
Instance Method Summary collapse
- #attributes ⇒ Hash{Symbol => Dry::Types::Type} private
-
#initialize(schema_name, schema_loader: SimpleSchemaLoader.new) ⇒ Schema
constructor
private
A new instance of Schema.
- #inspect ⇒ String private
Constructor Details
#initialize(schema_name, schema_loader: SimpleSchemaLoader.new) ⇒ Schema
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
use Hyrax::Schema(:my_schema) instead
Returns a new instance of Schema.
67 68 69 70 |
# File 'lib/hyrax/schema.rb', line 67 def initialize(schema_name, schema_loader: SimpleSchemaLoader.new) @name = schema_name @schema_loader = schema_loader end |
Instance Attribute Details
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
59 60 61 |
# File 'lib/hyrax/schema.rb', line 59 def name @name end |
Instance Method Details
#attributes ⇒ Hash{Symbol => Dry::Types::Type}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
74 75 76 |
# File 'lib/hyrax/schema.rb', line 74 def attributes @schema_loader.attributes_for(schema: name) end |
#inspect ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
80 81 82 |
# File 'lib/hyrax/schema.rb', line 80 def inspect "#{self.class}(#{@name})" end |