module Msg91ruby

Constants

VERSION

Public Class Methods

load_and_set_settings(*files) click to toggle source

Loads and sets the settings constant!

# File lib/msg91ruby.rb, line 40
def self.load_and_set_settings(*files)
  Kernel.send(:remove_const, Msg91ruby.const_name) if Kernel.const_defined?(Msg91ruby.const_name)
  Kernel.const_set(Msg91ruby.const_name, Msg91ruby.load_files(files))
end
load_files(*files) click to toggle source

Create a populated Options instance from a yaml file. If a second yaml file is given, then the sections of that file will overwrite the sections if the first file if they exist in the first file.

# File lib/msg91ruby.rb, line 26
def self.load_files(*files)
  config = Options.new

  # add yaml sources
  [files].flatten.compact.uniq.each do |file|
    config.add_source!(file.to_s)
  end

  config.load!
  config.load_env! if @@use_env
  config
end
reload!() click to toggle source
# File lib/msg91ruby.rb, line 45
def self.reload!
  Kernel.const_get(Msg91ruby.const_name).reload!
end
setup() { |self| ... } click to toggle source
# File lib/msg91ruby.rb, line 19
def self.setup
  yield self if @@_ran_once == false
  @@_ran_once = true
end