Class: ConfigReader
Overview
class ConfigReader
Just read a json file
Instance Method Summary collapse
- #extract_flags ⇒ Object
-
#initialize(file) ⇒ ConfigReader
constructor
A new instance of ConfigReader.
Methods included from Canoe::Err
Constructor Details
#initialize(file) ⇒ ConfigReader
Returns a new instance of ConfigReader.
9 10 11 |
# File 'lib/config_reader.rb', line 9 def initialize(file) @config_file = file end |
Instance Method Details
#extract_flags ⇒ Object
13 14 15 16 |
# File 'lib/config_reader.rb', line 13 def extract_flags abort_on_err("config file #{@config_file} does not exsit") unless File.exist? @config_file JSON.parse(File.read(@config_file)) end |