class RestData

stores rest service paths/responses

Public Class Methods

new(name = 'default') click to toggle source
# File lib/rest_data.rb, line 3
def initialize(name = 'default')
  @name = name
  @storage = {}
end

Public Instance Methods

add(path, message) click to toggle source
# File lib/rest_data.rb, line 8
def add(path, message)
  @storage[path] = message
end
get(path) click to toggle source
# File lib/rest_data.rb, line 12
def get(path)
  return @storage[path] unless @storage[path].nil?
  file = "data/#{path}.txt"
  return File.read(file) if File.exist?(file)
  ''
end