Class: Gorillib::Factory::BooleanFactory

Inherits:
ConvertingFactory show all
Defined in:
lib/gorillib/factories.rb

Direct Known Subclasses

Boolean10Factory

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ConvertingFactory

#receive

Methods inherited from BaseFactory

blankish?, #initialize, native?, #receive, #typename

Constructor Details

This class inherits a constructor from Gorillib::Factory::BaseFactory

Class Method Details

.typenameObject



470
# File 'lib/gorillib/factories.rb', line 470

def self.typename() :boolean ; end

Instance Method Details

#blankish?(obj) ⇒ Boolean

Returns:

  • (Boolean)


472
# File 'lib/gorillib/factories.rb', line 472

def blankish?(obj)   obj.nil? ; end

#convert(obj) ⇒ Object



474
# File 'lib/gorillib/factories.rb', line 474

def convert(obj)     (obj.to_s == "false") ? false : true ; end

#native?(obj) ⇒ Boolean

Returns:

  • (Boolean)


473
# File 'lib/gorillib/factories.rb', line 473

def native?(obj)     obj.equal?(true) || obj.equal?(false) ; end