Sha256: eb46a32bcf32be874bfa2b2bdc914b9dc53eac8fc8367c4afa8f97443ab97fa0

Contents?: true

Size: 381 Bytes

Versions: 3

Compression:

Stored size: 381 Bytes

Contents

module Silencer
  module Util

    def wrap(object)
      if object.nil?
        []
      elsif object.respond_to?(:to_ary)
        object.to_ary || [object]
      else
        [object]
      end
    end

    def extract_options!(args)
      if args.last.is_a?(Hash)
        args.pop
      else
        {}
      end
    end

    module_function :wrap, :extract_options!

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
silencer-1.0.0.rc3 lib/silencer/util.rb
silencer-1.0.0.rc2 lib/silencer/util.rb
silencer-1.0.0.rc1 lib/silencer/util.rb