Class: Binstream::Streams::StringReader

Inherits:
Base
  • Object
show all
Defined in:
lib/binstream/streams/string_reader.rb

Instance Attribute Summary

Attributes inherited from Base

#stopper

Instance Method Summary collapse

Methods inherited from Base

#dump, #eof?, #method_missing, #peek, #peek_slice, #read, #read_binary, #read_bool, #read_byte, #read_double, #read_doublebe, #read_float, #read_floatbe, #read_hash, #read_int16, #read_int16be, #read_int32, #read_int32be, #read_int64, #read_int64be, #read_int8, #read_single, #read_string, #read_uint16, #read_uint16be, #read_uint32, #read_uint32be, #read_uint64, #read_uint64be, #read_uint8, #read_unpack, #remaining, #remaining?, #reset, #rewind, #seek, #setup_stopper, #slice, #slice!, #starting_offset, #stell, #tell, #total_size, #valid_position?

Methods included from Tracking

included, #track, #track_pos, #without_tracking

Constructor Details

#initialize(path_or_io, **kwargs) ⇒ StringReader

Returns a new instance of StringReader.



5
6
7
8
9
10
11
# File 'lib/binstream/streams/string_reader.rb', line 5

def initialize(path_or_io, **kwargs)
  if path_or_io.is_a?(::StringIO)
    super(path_or_io, **kwargs)
  else
    super(::StringIO.new(path_or_io, "rb"), **kwargs)
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Binstream::Streams::Base