Sha256: 157e4c37746c727ae052d45a4ca94922a683eba662c8c58a77165c0f36c0b681

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

require 'servicenow/version'
require 'servicenow/client'
require 'servicenow/change'

module Servicenow

  @logger = nil
  @configuration = nil
  
  class BaseError < StandardError; end
  class MissingParameterError < BaseError; end


  # Set up Servicenow config
  #
  # @example Set up with username.  Password and URL would come from environemnt
  #   Servicenow.configure do |config|
  #     config.username = 'foo'
  #   end
  #
  # @yieldparam config [Servicenow::Configuration]
  def self.configure(&block)
    if @configuration.nil?
      @configuration = OpenStruct.new({})
    end
    yield @configuration
  end


  # @return [Servicenow::Configuration]
  def self.configuration
    if @configuration.nil?
      @configuration = OpenStruct.new({})
    end
    @configuration
  end


  # @param [Logger] new_logger new logger for module
  #
  # @return [Logger]
  def self.logger=(new_logger)
    @logger = new_logger
  end


  # @todo filter password
  #
  # @return [Logger] the module logger
  def self.logger
    if @logger.nil?
      @logger = Logger.new(STDOUT)
    end
    @logger
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
servicenow-1.1.2 lib/servicenow.rb
servicenow-1.1.1 lib/servicenow.rb
servicenow-1.1.0 lib/servicenow.rb
servicenow-1.0.0 lib/servicenow.rb