Class: Rafflesia::RelationDescriptor
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::RelationDescriptor
- Defined in:
- lib/rafflesia/registry/relation_descriptor.rb
Constant Summary collapse
- HASH_ATTRS =
{ capabilities: :capabilities, column_semantics: :column_semantics, columns: :columns, default_order: :default_order, description: :description, domain: :domain, entity_type: :entity_type, evidence_relationship_contracts: :evidence_relationship_contracts, grain: :grain, id: :id, identifier_fields: :identifier_fields, name: :name, object: :object, ontology_digest: :ontology_digest, ontology_version: :ontology_version, primary_key: :primary_key, quality_notes: :quality_notes, recommended_filters: :recommended_filters, relationships: :relationships, schema_hash: :schema_hash, schema_version: :schema_version, url: :url }.freeze
Instance Attribute Summary collapse
-
#capabilities ⇒ Object
Returns the value of attribute capabilities.
-
#column_semantics ⇒ Object
Returns the value of attribute column_semantics.
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#default_order ⇒ Object
Returns the value of attribute default_order.
-
#description ⇒ Object
Returns the value of attribute description.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#entity_type ⇒ Object
Returns the value of attribute entity_type.
-
#evidence_relationship_contracts ⇒ Object
Returns the value of attribute evidence_relationship_contracts.
-
#grain ⇒ Object
Returns the value of attribute grain.
-
#id ⇒ Object
Returns the value of attribute id.
-
#identifier_fields ⇒ Object
Returns the value of attribute identifier_fields.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object ⇒ Object
Returns the value of attribute object.
-
#ontology_digest ⇒ Object
Returns the value of attribute ontology_digest.
-
#ontology_version ⇒ Object
Returns the value of attribute ontology_version.
-
#primary_key ⇒ Object
Returns the value of attribute primary_key.
-
#quality_notes ⇒ Object
Returns the value of attribute quality_notes.
-
#recommended_filters ⇒ Object
Returns the value of attribute recommended_filters.
-
#relationships ⇒ Object
Returns the value of attribute relationships.
-
#schema_hash ⇒ Object
Returns the value of attribute schema_hash.
-
#schema_version ⇒ Object
Returns the value of attribute schema_version.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(json) ⇒ RelationDescriptor
constructor
A new instance of RelationDescriptor.
Constructor Details
#initialize(json) ⇒ RelationDescriptor
Returns a new instance of RelationDescriptor.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 57 def initialize(json) super() hash = self.class.normalize(json) @capabilities = hash[:capabilities] ? Rafflesia::RelationCapabilities.new(hash[:capabilities]) : nil @column_semantics = hash[:column_semantics] || {} @columns = (hash[:columns] || []).map { |item| item ? Rafflesia::TableColumn.new(item) : nil } @default_order = (hash[:default_order] || []) @description = hash[:description] @domain = hash[:domain] @entity_type = hash[:entity_type] @evidence_relationship_contracts = (hash[:evidence_relationship_contracts] || []).map { |item| item ? Rafflesia::OntologyEvidenceRelationshipContractData.new(item) : nil } @grain = hash[:grain] @id = hash[:id] @identifier_fields = hash[:identifier_fields] || {} @name = hash[:name] @object = hash[:object] @ontology_digest = hash[:ontology_digest] @ontology_version = hash[:ontology_version] @primary_key = hash[:primary_key] ? Rafflesia::RelationKey.new(hash[:primary_key]) : nil @quality_notes = (hash[:quality_notes] || []) @recommended_filters = (hash[:recommended_filters] || []) @relationships = (hash[:relationships] || []).map { |item| item ? Rafflesia::RelationRelationship.new(item) : nil } @schema_hash = hash[:schema_hash] @schema_version = hash[:schema_version] @url = hash[:url] end |
Instance Attribute Details
#capabilities ⇒ Object
Returns the value of attribute capabilities.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def capabilities @capabilities end |
#column_semantics ⇒ Object
Returns the value of attribute column_semantics.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def column_semantics @column_semantics end |
#columns ⇒ Object
Returns the value of attribute columns.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def columns @columns end |
#default_order ⇒ Object
Returns the value of attribute default_order.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def default_order @default_order end |
#description ⇒ Object
Returns the value of attribute description.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def description @description end |
#domain ⇒ Object
Returns the value of attribute domain.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def domain @domain end |
#entity_type ⇒ Object
Returns the value of attribute entity_type.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def entity_type @entity_type end |
#evidence_relationship_contracts ⇒ Object
Returns the value of attribute evidence_relationship_contracts.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def evidence_relationship_contracts @evidence_relationship_contracts end |
#grain ⇒ Object
Returns the value of attribute grain.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def grain @grain end |
#id ⇒ Object
Returns the value of attribute id.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def id @id end |
#identifier_fields ⇒ Object
Returns the value of attribute identifier_fields.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def identifier_fields @identifier_fields end |
#name ⇒ Object
Returns the value of attribute name.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def name @name end |
#object ⇒ Object
Returns the value of attribute object.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def object @object end |
#ontology_digest ⇒ Object
Returns the value of attribute ontology_digest.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def ontology_digest @ontology_digest end |
#ontology_version ⇒ Object
Returns the value of attribute ontology_version.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def ontology_version @ontology_version end |
#primary_key ⇒ Object
Returns the value of attribute primary_key.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def primary_key @primary_key end |
#quality_notes ⇒ Object
Returns the value of attribute quality_notes.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def quality_notes @quality_notes end |
#recommended_filters ⇒ Object
Returns the value of attribute recommended_filters.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def recommended_filters @recommended_filters end |
#relationships ⇒ Object
Returns the value of attribute relationships.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def relationships @relationships end |
#schema_hash ⇒ Object
Returns the value of attribute schema_hash.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def schema_hash @schema_hash end |
#schema_version ⇒ Object
Returns the value of attribute schema_version.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def schema_version @schema_version end |
#url ⇒ Object
Returns the value of attribute url.
33 34 35 |
# File 'lib/rafflesia/registry/relation_descriptor.rb', line 33 def url @url end |