Class: Rafflesia::OntologyRelationshipData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::OntologyRelationshipData
- Defined in:
- lib/rafflesia/ontology/ontology_relationship_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ cardinality: :cardinality, coordinate_notes: :coordinate_notes, from_relation: :from_relation, id: :id, is_lossy: :is_lossy, is_range_mapping: :is_range_mapping, object: :object, ontology_digest: :ontology_digest, ontology_version: :ontology_version, safety: :safety, safety_reason: :safety_reason, to_relation: :to_relation, url: :url, variants: :variants }.freeze
Instance Attribute Summary collapse
-
#cardinality ⇒ Object
Returns the value of attribute cardinality.
-
#coordinate_notes ⇒ Object
Returns the value of attribute coordinate_notes.
-
#from_relation ⇒ Object
Returns the value of attribute from_relation.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_lossy ⇒ Object
Returns the value of attribute is_lossy.
-
#is_range_mapping ⇒ Object
Returns the value of attribute is_range_mapping.
-
#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.
-
#safety ⇒ Object
Returns the value of attribute safety.
-
#safety_reason ⇒ Object
Returns the value of attribute safety_reason.
-
#to_relation ⇒ Object
Returns the value of attribute to_relation.
-
#url ⇒ Object
Returns the value of attribute url.
-
#variants ⇒ Object
Returns the value of attribute variants.
Instance Method Summary collapse
-
#initialize(json) ⇒ OntologyRelationshipData
constructor
A new instance of OntologyRelationshipData.
Constructor Details
#initialize(json) ⇒ OntologyRelationshipData
Returns a new instance of OntologyRelationshipData.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 41 def initialize(json) super() hash = self.class.normalize(json) @cardinality = hash[:cardinality] @coordinate_notes = hash[:coordinate_notes] @from_relation = hash[:from_relation] @id = hash[:id] @is_lossy = hash[:is_lossy] @is_range_mapping = hash[:is_range_mapping] @object = hash[:object] @ontology_digest = hash[:ontology_digest] @ontology_version = hash[:ontology_version] @safety = hash[:safety] @safety_reason = hash[:safety_reason] @to_relation = hash[:to_relation] @url = hash[:url] @variants = (hash[:variants] || []).map { |item| item ? Rafflesia::OntologyJoinStep.new(item) : nil } end |
Instance Attribute Details
#cardinality ⇒ Object
Returns the value of attribute cardinality.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def cardinality @cardinality end |
#coordinate_notes ⇒ Object
Returns the value of attribute coordinate_notes.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def coordinate_notes @coordinate_notes end |
#from_relation ⇒ Object
Returns the value of attribute from_relation.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def from_relation @from_relation end |
#id ⇒ Object
Returns the value of attribute id.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def id @id end |
#is_lossy ⇒ Object
Returns the value of attribute is_lossy.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def is_lossy @is_lossy end |
#is_range_mapping ⇒ Object
Returns the value of attribute is_range_mapping.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def is_range_mapping @is_range_mapping end |
#object ⇒ Object
Returns the value of attribute object.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def object @object end |
#ontology_digest ⇒ Object
Returns the value of attribute ontology_digest.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def ontology_digest @ontology_digest end |
#ontology_version ⇒ Object
Returns the value of attribute ontology_version.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def ontology_version @ontology_version end |
#safety ⇒ Object
Returns the value of attribute safety.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def safety @safety end |
#safety_reason ⇒ Object
Returns the value of attribute safety_reason.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def safety_reason @safety_reason end |
#to_relation ⇒ Object
Returns the value of attribute to_relation.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def to_relation @to_relation end |
#url ⇒ Object
Returns the value of attribute url.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def url @url end |
#variants ⇒ Object
Returns the value of attribute variants.
25 26 27 |
# File 'lib/rafflesia/ontology/ontology_relationship_data.rb', line 25 def variants @variants end |