module Cloudimage::Refinements

Public Instance Methods

delete_prefix(prefix) click to toggle source
# File lib/cloudimage/refinements.rb, line 17
def delete_prefix(prefix)
  sub(/\A#{prefix}/, '')
end
slice(*keys) click to toggle source
# File lib/cloudimage/refinements.rb, line 7
def slice(*keys)
  keys.each_with_object({}) do |k, acc|
    acc[k] = self[k] if key?(k)
  end
end
then() click to toggle source
# File lib/cloudimage/refinements.rb, line 39
def then
  return yield_self unless block_given?

  yield_self(&::Proc.new)
end
yield_self() { |self| ... } click to toggle source
# File lib/cloudimage/refinements.rb, line 25
def yield_self
  unless block_given?
    return ::Enumerator.new(1) do |yielder|
      yielder.yield(self)
    end
  end

  yield(self)
end