class Ocular

Some of this code is copied from the excellent Sinatra Ruby web library by Blake Mizerany and Konstantin Haase.

OriginalAuthor

Adam Jacob (<adam@opscode.com>)

OriginalAuthor

Christopher Walters (<cw@opscode.com>)

Copyright

Copyright © 2008 Opscode, Inc.

License

Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Constants

Version

Public Class Methods

deep_symbolize(obj) click to toggle source
# File lib/ocular/utils.rb, line 2
def self.deep_symbolize(obj)
    return obj.inject({}){|memo,(k,v)| memo[k.to_sym] =  deep_symbolize(v); memo} if obj.is_a? Hash
    return obj.inject([]){|memo,v    | memo           << deep_symbolize(v); memo} if obj.is_a? Array
    return obj
end
logger() click to toggle source
# File lib/ocular/ocular.rb, line 7
def self.logger
    return $ocular_global_logger
end
set_global_logger(logger) click to toggle source
# File lib/ocular/ocular.rb, line 11
def self.set_global_logger(logger)
    $ocular_global_logger = logger
end