Class: ActiveMocker::StringReader Private

Inherits:
Object
  • Object
show all
Defined in:
lib/active_mocker/string_reader.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ StringReader

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of StringReader.



4
5
6
# File 'lib/active_mocker/string_reader.rb', line 4

def initialize(file)
  @read = file
end

Instance Method Details

#read(path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
11
12
13
14
# File 'lib/active_mocker/string_reader.rb', line 8

def read(path)
  if @read.is_a?(Hash)
    @read[path.sub('/','').sub('.rb','')]
  else
    @read
  end
end