Sha256: 103ef0493d232d414e0db3b0a31e720ced82f9c47ee42200452575976f55deb2

Contents?: true

Size: 515 Bytes

Versions: 7

Compression:

Stored size: 515 Bytes

Contents

module Puffer
  module Extensions

    module String
      def singular?
        self.singularize == self
      end

      def plural?
        self.pluralize == self
      end
    end

    module Symbol
      def singular?
        to_s.singular?
      end

      def plural?
        to_s.plural?
      end
    end

  end
end

String.send :include, Puffer::Extensions::String
Symbol.send :include, Puffer::Extensions::Symbol

Kernel.class_eval do
  def swallow_nil
    yield
  rescue NoMethodError
    nil
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
puffer-0.0.7 lib/puffer/extensions/core.rb
puffer-0.0.6 lib/puffer/extensions/core.rb
puffer-0.0.5 lib/puffer/extensions/core.rb
puffer-0.0.4 lib/puffer/extensions/core.rb
puffer-0.0.3 lib/puffer/extensions/core.rb
puffer-0.0.2 lib/puffer/extensions/core.rb
puffer-0.0.1 lib/puffer/extensions/core.rb