Class: Rafflesia::CorpuReleaseRecord
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::CorpuReleaseRecord
- Defined in:
- lib/rafflesia/datasets/corpu_release_record.rb
Constant Summary collapse
- HASH_ATTRS =
{ corpus: :corpus, created_at: :created_at, families: :families, family_count: :family_count, is_current: :is_current, ref: :ref, release_id: :release_id, release_object: :release_object, source_snapshots: :source_snapshots, validation: :validation }.freeze
Instance Attribute Summary collapse
-
#corpus ⇒ Object
Returns the value of attribute corpus.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#families ⇒ Object
Returns the value of attribute families.
-
#family_count ⇒ Object
Returns the value of attribute family_count.
-
#is_current ⇒ Object
Returns the value of attribute is_current.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#release_id ⇒ Object
Returns the value of attribute release_id.
-
#release_object ⇒ Object
Returns the value of attribute release_object.
-
#source_snapshots ⇒ Object
Returns the value of attribute source_snapshots.
-
#validation ⇒ Object
Returns the value of attribute validation.
Instance Method Summary collapse
-
#initialize(json) ⇒ CorpuReleaseRecord
constructor
A new instance of CorpuReleaseRecord.
Constructor Details
#initialize(json) ⇒ CorpuReleaseRecord
Returns a new instance of CorpuReleaseRecord.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 33 def initialize(json) super() hash = self.class.normalize(json) @corpus = hash[:corpus] @created_at = hash[:created_at] @families = (hash[:families] || []) @family_count = hash[:family_count] @is_current = hash[:is_current] @ref = hash[:ref] @release_id = hash[:release_id] @release_object = hash[:release_object] @source_snapshots = (hash[:source_snapshots] || []).map { |item| item ? Rafflesia::CorpuReleaseSourceSnapshot.new(item) : nil } @validation = hash[:validation] || {} end |
Instance Attribute Details
#corpus ⇒ Object
Returns the value of attribute corpus.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def corpus @corpus end |
#created_at ⇒ Object
Returns the value of attribute created_at.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def created_at @created_at end |
#families ⇒ Object
Returns the value of attribute families.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def families @families end |
#family_count ⇒ Object
Returns the value of attribute family_count.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def family_count @family_count end |
#is_current ⇒ Object
Returns the value of attribute is_current.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def is_current @is_current end |
#ref ⇒ Object
Returns the value of attribute ref.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def ref @ref end |
#release_id ⇒ Object
Returns the value of attribute release_id.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def release_id @release_id end |
#release_object ⇒ Object
Returns the value of attribute release_object.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def release_object @release_object end |
#source_snapshots ⇒ Object
Returns the value of attribute source_snapshots.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def source_snapshots @source_snapshots end |
#validation ⇒ Object
Returns the value of attribute validation.
21 22 23 |
# File 'lib/rafflesia/datasets/corpu_release_record.rb', line 21 def validation @validation end |