Class: Rafflesia::SearchSegmentRoot
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::SearchSegmentRoot
- Defined in:
- lib/rafflesia/proteins/search_segment_root.rb
Constant Summary collapse
- HASH_ATTRS =
{ block_bytes: :block_bytes, block_count: :block_count, content_sha256: :content_sha_256, key_mode: :key_mode, kind: :kind, schema_version: :schema_version, segment_id: :segment_id, sparse_entries: :sparse_entries }.freeze
Instance Attribute Summary collapse
-
#block_bytes ⇒ Object
Returns the value of attribute block_bytes.
-
#block_count ⇒ Object
Returns the value of attribute block_count.
-
#content_sha_256 ⇒ Object
Returns the value of attribute content_sha_256.
-
#key_mode ⇒ Object
Returns the value of attribute key_mode.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#schema_version ⇒ Object
Returns the value of attribute schema_version.
-
#segment_id ⇒ Object
Returns the value of attribute segment_id.
-
#sparse_entries ⇒ Object
Returns the value of attribute sparse_entries.
Instance Method Summary collapse
-
#initialize(json) ⇒ SearchSegmentRoot
constructor
A new instance of SearchSegmentRoot.
Constructor Details
#initialize(json) ⇒ SearchSegmentRoot
Returns a new instance of SearchSegmentRoot.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 29 def initialize(json) super() hash = self.class.normalize(json) @block_bytes = hash[:block_bytes] @block_count = hash[:block_count] @content_sha_256 = hash[:content_sha256] @key_mode = hash[:key_mode] @kind = hash[:kind] @schema_version = hash[:schema_version] @segment_id = hash[:segment_id] @sparse_entries = (hash[:sparse_entries] || []).map { |item| item ? Rafflesia::SearchSegmentSparseEntry.new(item) : nil } end |
Instance Attribute Details
#block_bytes ⇒ Object
Returns the value of attribute block_bytes.
19 20 21 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 19 def block_bytes @block_bytes end |
#block_count ⇒ Object
Returns the value of attribute block_count.
19 20 21 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 19 def block_count @block_count end |
#content_sha_256 ⇒ Object
Returns the value of attribute content_sha_256.
19 20 21 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 19 def content_sha_256 @content_sha_256 end |
#key_mode ⇒ Object
Returns the value of attribute key_mode.
19 20 21 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 19 def key_mode @key_mode end |
#kind ⇒ Object
Returns the value of attribute kind.
19 20 21 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 19 def kind @kind end |
#schema_version ⇒ Object
Returns the value of attribute schema_version.
19 20 21 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 19 def schema_version @schema_version end |
#segment_id ⇒ Object
Returns the value of attribute segment_id.
19 20 21 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 19 def segment_id @segment_id end |
#sparse_entries ⇒ Object
Returns the value of attribute sparse_entries.
19 20 21 |
# File 'lib/rafflesia/proteins/search_segment_root.rb', line 19 def sparse_entries @sparse_entries end |