Module: JSON

Defined in:
lib/ruby/commons/core_ext/json/include.rb

Overview

How to include a YAML file inside a YAML file?

Class Method Summary collapse

Class Method Details

.mp_include(file_name) ⇒ Object

TODO



7
8
9
10
# File 'lib/ruby/commons/core_ext/json/include.rb', line 7

def self.mp_include(file_name)
  require 'erb'
  ERB.new(IO.read(file_name)).result
end

.mp_load_erb(file_name) ⇒ Object

TODO



14
15
16
# File 'lib/ruby/commons/core_ext/json/include.rb', line 14

def self.mp_load_erb(file_name)
  JSON::load(JSON::mp_include(file_name))
end