Sha256: 740a506d027e822c76af2ada641017451c1281c85940b69162bdb4ede8876559

Contents?: true

Size: 404 Bytes

Versions: 3

Compression:

Stored size: 404 Bytes

Contents

module Inkwell
  module Common
    def is_comment(obj)
      post_class = Object.const_get ::Inkwell::Engine::config.post_table.to_s.singularize.capitalize
      case obj
        when ::Inkwell::Comment
          is_comment = true
        when post_class
          is_comment = false
        else
          raise "obj should be Comment or #{post_class.class}"
      end
      is_comment
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
inkwell-0.1.1 lib/common/base.rb
inkwell-0.0.3 lib/common/base.rb
inkwell-0.0.1 lib/common/base.rb