Class: Web2Go::MockFile
- Inherits:
-
Object
- Object
- Web2Go::MockFile
- Defined in:
- lib/Web2Go/MockRequest.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(filename, content = nil) ⇒ MockFile
constructor
A new instance of MockFile.
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
#content ⇒ Object (readonly)
Returns the value of attribute content.
11 12 13 |
# File 'lib/Web2Go/MockRequest.rb', line 11 def content @content end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
10 11 12 |
# File 'lib/Web2Go/MockRequest.rb', line 10 def filename @filename end |