Class: Rafflesia::SearchSegmentBlock

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/search_segment_block.rb

Constant Summary collapse

HASH_ATTRS =
{
  block_index: :block_index,
  end_key: :end_key,
  object: :object,
  range_length_bytes: :range_length_bytes,
  range_offset_bytes: :range_offset_bytes,
  sha256: :sha_256,
  size_bytes: :size_bytes,
  start_key: :start_key
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ SearchSegmentBlock

Returns a new instance of SearchSegmentBlock.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 29

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @block_index = hash[:block_index]
  @end_key = hash[:end_key]
  @object = hash[:object] ? Rafflesia::ObjectRef.new(hash[:object]) : nil
  @range_length_bytes = hash[:range_length_bytes]
  @range_offset_bytes = hash[:range_offset_bytes]
  @sha_256 = hash[:sha256]
  @size_bytes = hash[:size_bytes]
  @start_key = hash[:start_key]
end

Instance Attribute Details

#block_indexObject

Returns the value of attribute block_index.



19
20
21
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 19

def block_index
  @block_index
end

#end_keyObject

Returns the value of attribute end_key.



19
20
21
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 19

def end_key
  @end_key
end

#objectObject

Returns the value of attribute object.



19
20
21
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 19

def object
  @object
end

#range_length_bytesObject

Returns the value of attribute range_length_bytes.



19
20
21
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 19

def range_length_bytes
  @range_length_bytes
end

#range_offset_bytesObject

Returns the value of attribute range_offset_bytes.



19
20
21
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 19

def range_offset_bytes
  @range_offset_bytes
end

#sha_256Object

Returns the value of attribute sha_256.



19
20
21
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 19

def sha_256
  @sha_256
end

#size_bytesObject

Returns the value of attribute size_bytes.



19
20
21
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 19

def size_bytes
  @size_bytes
end

#start_keyObject

Returns the value of attribute start_key.



19
20
21
# File 'lib/rafflesia/proteins/search_segment_block.rb', line 19

def start_key
  @start_key
end