salkar/inkwell

View on GitHub
lib/inkwell/errors/not_bloggable.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Inkwell
  module Errors
    class NotBloggable < StandardError
      def initialize(object)
        @object = object
      end

      def message
        # move to <<~ when ruby supported version starts 2.3 or upper version
        <<-MESSAGE
#{@object.class} cannot be added to blog.
include Inkwell::CanBeBlogged to #{@object.class} if this object should be added to blog.
        MESSAGE
      end
    end
  end
end