Class: DcmgrResource::Mock

Inherits:
Object
  • Object
show all
Defined in:
app/models/dcmgr_resource/mock.rb

Class Method Summary collapse

Class Method Details

.load(load) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'app/models/dcmgr_resource/mock.rb', line 3

def self.load(load)
  root = File.expand_path('../')
  load = File::split(load)
  namespace = load[0]
  file = load[1] + '.json'
  dir = File.join(root,'common','data','mock',namespace)
  jsonfile = File.join(dir,file)
  json = ''
  open(jsonfile) {|f| json = f.read }
  json
end