Method: ImageSize::ISOBMFF::Box#initialize

Defined in:
lib/image_size/isobmff.rb

#initialize(attributes) ⇒ Box

Returns a new instance of Box.



12
13
14
15
16
17
18
# File 'lib/image_size/isobmff.rb', line 12

def initialize(attributes)
  @type = attributes.fetch(:type)
  @offset = attributes.fetch(:offset)
  @size = attributes.fetch(:size) == 0 ? nil : attributes[:size]
  @relative_data_offset = attributes.fetch(:relative_data_offset)
  @index = attributes.fetch(:index)
end