diff --git a/lib/awesome_print/types.rb b/lib/awesome_print/types.rb index cc53900..04bdfda 100644 --- a/lib/awesome_print/types.rb +++ b/lib/awesome_print/types.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - require 'awesome_print/types/base' + require 'awesome_print/types/type' require 'awesome_print/types/active_record' if defined?(ActiveRecord) || AwesomePrint.rails_console? require 'awesome_print/types/active_support' if defined?(ActiveSupport) || AwesomePrint.rails_console? require 'awesome_print/types/mongoid' if defined?(Mongoid) diff --git a/lib/awesome_print/types/active_record.rb b/lib/awesome_print/types/active_record.rb index 1dd05a1..edac9ac 100644 --- a/lib/awesome_print/types/active_record.rb +++ b/lib/awesome_print/types/active_record.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class ActiveRecord < Base + class ActiveRecord < Type def call if object.is_a?(::ActiveRecord::Base) diff --git a/lib/awesome_print/types/active_support.rb b/lib/awesome_print/types/active_support.rb index b67ef7f..e0b4a00 100644 --- a/lib/awesome_print/types/active_support.rb +++ b/lib/awesome_print/types/active_support.rb @@ -4,7 +4,7 @@ end module AwesomePrint module Types - class ActiveSupport < Base + class ActiveSupport < Type def call if (defined?(::ActiveSupport::TimeWithZone) && object.is_a?(::ActiveSupport::TimeWithZone)) || object.is_a?(::Date) diff --git a/lib/awesome_print/types/mongo_mapper.rb b/lib/awesome_print/types/mongo_mapper.rb index b9bc938..f51899d 100644 --- a/lib/awesome_print/types/mongo_mapper.rb +++ b/lib/awesome_print/types/mongo_mapper.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class MongoMapper < Base + class MongoMapper < Type def call if object.is_a?(Class) && (object.ancestors & [ ::MongoMapper::Document, ::MongoMapper::EmbeddedDocument ]).size > 0 diff --git a/lib/awesome_print/types/mongoid.rb b/lib/awesome_print/types/mongoid.rb index 2650b94..235d317 100644 --- a/lib/awesome_print/types/mongoid.rb +++ b/lib/awesome_print/types/mongoid.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class Mongoid < Base + class Mongoid < Type def call if object.is_a?(Class) && object.ancestors.include?(::Mongoid::Document) diff --git a/lib/awesome_print/types/no_brainer.rb b/lib/awesome_print/types/no_brainer.rb index 8b17c94..d22362f 100644 --- a/lib/awesome_print/types/no_brainer.rb +++ b/lib/awesome_print/types/no_brainer.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class NoBrainer < Base + class NoBrainer < Type def call if object.is_a?(Class) && object < ::NoBrainer::Document diff --git a/lib/awesome_print/types/nokogiri.rb b/lib/awesome_print/types/nokogiri.rb index e53e56e..2f7b2e0 100644 --- a/lib/awesome_print/types/nokogiri.rb +++ b/lib/awesome_print/types/nokogiri.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class Nokogiri < Base + class Nokogiri < Type def call if (defined?(::Nokogiri::XML::Node) && object.is_a?(::Nokogiri::XML::Node)) || diff --git a/lib/awesome_print/types/ostruct.rb b/lib/awesome_print/types/ostruct.rb index 8c720c2..cc55d5a 100644 --- a/lib/awesome_print/types/ostruct.rb +++ b/lib/awesome_print/types/ostruct.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class OpenStruct < Base + class OpenStruct < Type def call if (defined?(::OpenStruct)) && (object.is_a?(::OpenStruct)) diff --git a/lib/awesome_print/types/ripple.rb b/lib/awesome_print/types/ripple.rb index e6cd8f5..33874a2 100644 --- a/lib/awesome_print/types/ripple.rb +++ b/lib/awesome_print/types/ripple.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class Ripple < Base + class Ripple < Type def call if object.is_a?(::Ripple::AttributeMethods) # Module used to access attributes across documents and embedded documents diff --git a/lib/awesome_print/types/sequel.rb b/lib/awesome_print/types/sequel.rb index c5dc999..9e52f5f 100644 --- a/lib/awesome_print/types/sequel.rb +++ b/lib/awesome_print/types/sequel.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class Sequel < Base + class Sequel < Type def call if defined?(::Sequel::Model) && object.is_a?(::Sequel::Model) diff --git a/lib/awesome_print/types/base.rb b/lib/awesome_print/types/type.rb similarity index 91% rename from lib/awesome_print/types/base.rb rename to lib/awesome_print/types/type.rb index f11aa4c..6c0efc2 100644 --- a/lib/awesome_print/types/base.rb +++ b/lib/awesome_print/types/type.rb @@ -1,6 +1,6 @@ module AwesomePrint module Types - class Base + class Type def initialize(object) @object = object