Class: Clumsy::TestFile
- Inherits:
-
Object
- Object
- Clumsy::TestFile
- Defined in:
- lib/clumsy/test_file.rb
Instance Method Summary collapse
- #downstream ⇒ Object
-
#initialize(file) ⇒ TestFile
constructor
A new instance of TestFile.
- #request_method ⇒ Object
- #request_url ⇒ Object
- #response ⇒ Object
Constructor Details
#initialize(file) ⇒ TestFile
Returns a new instance of TestFile.
4 5 6 7 8 9 10 11 |
# File 'lib/clumsy/test_file.rb', line 4 def initialize(file) begin @file = File.read(file) @data = Hashie::Mash.new JSON.parse(@file) rescue Errno::ENOENT raise 'File Not Found' end end |
Instance Method Details
#downstream ⇒ Object
21 22 23 |
# File 'lib/clumsy/test_file.rb', line 21 def downstream @data.downstream end |
#request_method ⇒ Object
13 14 15 |
# File 'lib/clumsy/test_file.rb', line 13 def request_method @data.request_method end |
#request_url ⇒ Object
17 18 19 |
# File 'lib/clumsy/test_file.rb', line 17 def request_url @data.request_url end |
#response ⇒ Object
25 26 27 |
# File 'lib/clumsy/test_file.rb', line 25 def response @data.response end |