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:
parent
de51f83260
commit
896e8f7d4e
11 changed files with 11 additions and 11 deletions
|
@ -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)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module AwesomePrint
|
||||
module Types
|
||||
class ActiveRecord < Base
|
||||
class ActiveRecord < Type
|
||||
|
||||
def call
|
||||
if object.is_a?(::ActiveRecord::Base)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module AwesomePrint
|
||||
module Types
|
||||
class NoBrainer < Base
|
||||
class NoBrainer < Type
|
||||
|
||||
def call
|
||||
if object.is_a?(Class) && object < ::NoBrainer::Document
|
||||
|
|
|
@ -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)) ||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module AwesomePrint
|
||||
module Types
|
||||
class OpenStruct < Base
|
||||
class OpenStruct < Type
|
||||
|
||||
def call
|
||||
if (defined?(::OpenStruct)) && (object.is_a?(::OpenStruct))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module AwesomePrint
|
||||
module Types
|
||||
class Base
|
||||
class Type
|
||||
|
||||
def initialize(object)
|
||||
@object = object
|
Loading…
Reference in a new issue