Method: RubySMB::Fscc::EaInfoArray#insert

Defined in:
lib/ruby_smb/fscc/ea_info_array.rb

#insert(index, *objs) ⇒ self

Overrides the insert method in BinData::Array to call #update_offsets.

Parameters:

  • index (Integer)

    the index to insert into the array at

  • objs (Array<Object>)

    the objects to be inserted

Returns:

  • (self)

Raises:



27
28
29
30
31
32
33
34
35
# File 'lib/ruby_smb/fscc/ea_info_array.rb', line 27

def insert(index, *objs)
  objs.each do |x|
    unless x.is_a? RubySMB::Fscc::FileFullEaInfo
      raise ArgumentError, 'This array can only contain RubySMB::Fscc::FileFullEaInfo objects'
    end
  end
  super(index, *objs)
  update_offsets
end