Class: Rafflesia::OntologyDiffData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/ontology/ontology_diff_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  added_count: :added_count,
  affected_relations: :affected_relations,
  affected_vocabulary_kinds: :affected_vocabulary_kinds,
  available_digests: :available_digests,
  change_count: :change_count,
  changes: :changes,
  from_digest: :from_digest,
  from_source: :from_source,
  id: :id,
  is_changed: :is_changed,
  modified_count: :modified_count,
  object: :object,
  removed_count: :removed_count,
  to_digest: :to_digest,
  to_source: :to_source
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ OntologyDiffData

Returns a new instance of OntologyDiffData.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 43

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @added_count = hash[:added_count]
  @affected_relations = (hash[:affected_relations] || [])
  @affected_vocabulary_kinds = (hash[:affected_vocabulary_kinds] || [])
  @available_digests = (hash[:available_digests] || [])
  @change_count = hash[:change_count]
  @changes = (hash[:changes] || []).map { |item| item ? Rafflesia::OntologyDiffChange.new(item) : nil }
  @from_digest = hash[:from_digest]
  @from_source = hash[:from_source]
  @id = hash[:id]
  @is_changed = hash[:is_changed]
  @modified_count = hash[:modified_count]
  @object = hash[:object]
  @removed_count = hash[:removed_count]
  @to_digest = hash[:to_digest]
  @to_source = hash[:to_source]
end

Instance Attribute Details

#added_countObject

Returns the value of attribute added_count.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def added_count
  @added_count
end

#affected_relationsObject

Returns the value of attribute affected_relations.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def affected_relations
  @affected_relations
end

#affected_vocabulary_kindsObject

Returns the value of attribute affected_vocabulary_kinds.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def affected_vocabulary_kinds
  @affected_vocabulary_kinds
end

#available_digestsObject

Returns the value of attribute available_digests.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def available_digests
  @available_digests
end

#change_countObject

Returns the value of attribute change_count.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def change_count
  @change_count
end

#changesObject

Returns the value of attribute changes.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def changes
  @changes
end

#from_digestObject

Returns the value of attribute from_digest.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def from_digest
  @from_digest
end

#from_sourceObject

Returns the value of attribute from_source.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def from_source
  @from_source
end

#idObject

Returns the value of attribute id.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def id
  @id
end

#is_changedObject

Returns the value of attribute is_changed.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def is_changed
  @is_changed
end

#modified_countObject

Returns the value of attribute modified_count.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def modified_count
  @modified_count
end

#objectObject

Returns the value of attribute object.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def object
  @object
end

#removed_countObject

Returns the value of attribute removed_count.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def removed_count
  @removed_count
end

#to_digestObject

Returns the value of attribute to_digest.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def to_digest
  @to_digest
end

#to_sourceObject

Returns the value of attribute to_source.



26
27
28
# File 'lib/rafflesia/ontology/ontology_diff_data.rb', line 26

def to_source
  @to_source
end