Class: Web2Go::MockFile

Inherits:
Object
  • Object
show all
Defined in:
lib/Web2Go/MockRequest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, content = nil) ⇒ MockFile

Returns a new instance of MockFile.



13
14
15
16
17
18
19
20
21
# File 'lib/Web2Go/MockRequest.rb', line 13

def initialize(filename,content=nil)
  @filename = filename
  if content.nil? then
    File.open(filename,"r") do |f|
      content = f.read
    end
  end
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



11
12
13
# File 'lib/Web2Go/MockRequest.rb', line 11

def content
  @content
end

#filenameObject (readonly)

Returns the value of attribute filename.



10
11
12
# File 'lib/Web2Go/MockRequest.rb', line 10

def filename
  @filename
end