Class: Atum::Core::Schema::ResourceSchema
- Inherits:
-
Object
- Object
- Atum::Core::Schema::ResourceSchema
- Defined in:
- lib/atum/core/schema/resource_schema.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(schema, definition, name) ⇒ ResourceSchema
constructor
Instantiate a resource schema.
-
#link_schema_for(name) ⇒ Object
Get a schema for a named link.
-
#link_schemas ⇒ Array<LinkSchema>
The link schema children that are part of this resource schema.
Constructor Details
#initialize(schema, definition, name) ⇒ ResourceSchema
Instantiate a resource schema.
11 12 13 14 15 |
# File 'lib/atum/core/schema/resource_schema.rb', line 11 def initialize(schema, definition, name) @schema = schema @name = name @definition = definition end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/atum/core/schema/resource_schema.rb', line 5 def name @name end |
Instance Method Details
#link_schema_for(name) ⇒ Object
Get a schema for a named link.
25 26 27 28 29 |
# File 'lib/atum/core/schema/resource_schema.rb', line 25 def link_schema_for(name) link_schema = link_schema_hash[name] raise SchemaError, "Unknown link '#{name}'." unless link_schema link_schema end |
#link_schemas ⇒ Array<LinkSchema>
The link schema children that are part of this resource schema.
34 35 36 |
# File 'lib/atum/core/schema/resource_schema.rb', line 34 def link_schemas link_schema_hash.values end |