Class: Retab::PartitionChunk
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::PartitionChunk
- Defined in:
- lib/retab/partitions/partition_chunk.rb
Constant Summary collapse
- HASH_ATTRS =
{ key: :key, pages: :pages }.freeze
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#pages ⇒ Object
Returns the value of attribute pages.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ PartitionChunk
constructor
A new instance of PartitionChunk.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ PartitionChunk
Returns a new instance of PartitionChunk.
17 18 19 20 21 |
# File 'lib/retab/partitions/partition_chunk.rb', line 17 def initialize(json) hash = self.class.normalize(json) @key = hash[:key] @pages = (hash[:pages] || []) end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
13 14 15 |
# File 'lib/retab/partitions/partition_chunk.rb', line 13 def key @key end |
#pages ⇒ Object
Returns the value of attribute pages.
13 14 15 |
# File 'lib/retab/partitions/partition_chunk.rb', line 13 def pages @pages end |