1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Rename Base type to Type

This commit is contained in:
Mauro George 2015-03-19 18:14:42 -03:00
parent de51f83260
commit 896e8f7d4e
11 changed files with 11 additions and 11 deletions

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types 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_record' if defined?(ActiveRecord) || AwesomePrint.rails_console?
require 'awesome_print/types/active_support' if defined?(ActiveSupport) || AwesomePrint.rails_console? require 'awesome_print/types/active_support' if defined?(ActiveSupport) || AwesomePrint.rails_console?
require 'awesome_print/types/mongoid' if defined?(Mongoid) require 'awesome_print/types/mongoid' if defined?(Mongoid)

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class ActiveRecord < Base class ActiveRecord < Type
def call def call
if object.is_a?(::ActiveRecord::Base) if object.is_a?(::ActiveRecord::Base)

View file

@ -4,7 +4,7 @@ end
module AwesomePrint module AwesomePrint
module Types module Types
class ActiveSupport < Base class ActiveSupport < Type
def call def call
if (defined?(::ActiveSupport::TimeWithZone) && object.is_a?(::ActiveSupport::TimeWithZone)) || object.is_a?(::Date) if (defined?(::ActiveSupport::TimeWithZone) && object.is_a?(::ActiveSupport::TimeWithZone)) || object.is_a?(::Date)

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class MongoMapper < Base class MongoMapper < Type
def call def call
if object.is_a?(Class) && (object.ancestors & [ ::MongoMapper::Document, ::MongoMapper::EmbeddedDocument ]).size > 0 if object.is_a?(Class) && (object.ancestors & [ ::MongoMapper::Document, ::MongoMapper::EmbeddedDocument ]).size > 0

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class Mongoid < Base class Mongoid < Type
def call def call
if object.is_a?(Class) && object.ancestors.include?(::Mongoid::Document) if object.is_a?(Class) && object.ancestors.include?(::Mongoid::Document)

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class NoBrainer < Base class NoBrainer < Type
def call def call
if object.is_a?(Class) && object < ::NoBrainer::Document if object.is_a?(Class) && object < ::NoBrainer::Document

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class Nokogiri < Base class Nokogiri < Type
def call def call
if (defined?(::Nokogiri::XML::Node) && object.is_a?(::Nokogiri::XML::Node)) || if (defined?(::Nokogiri::XML::Node) && object.is_a?(::Nokogiri::XML::Node)) ||

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class OpenStruct < Base class OpenStruct < Type
def call def call
if (defined?(::OpenStruct)) && (object.is_a?(::OpenStruct)) if (defined?(::OpenStruct)) && (object.is_a?(::OpenStruct))

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class Ripple < Base class Ripple < Type
def call def call
if object.is_a?(::Ripple::AttributeMethods) # Module used to access attributes across documents and embedded documents if object.is_a?(::Ripple::AttributeMethods) # Module used to access attributes across documents and embedded documents

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class Sequel < Base class Sequel < Type
def call def call
if defined?(::Sequel::Model) && object.is_a?(::Sequel::Model) if defined?(::Sequel::Model) && object.is_a?(::Sequel::Model)

View file

@ -1,6 +1,6 @@
module AwesomePrint module AwesomePrint
module Types module Types
class Base class Type
def initialize(object) def initialize(object)
@object = object @object = object