Class: Gorillib::Factory::Boolean10Factory

Inherits:
BooleanFactory show all
Defined in:
lib/gorillib/type/extended.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BooleanFactory

#blankish?, #native?

Methods inherited from ConvertingFactory

#receive

Methods inherited from BaseFactory

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

Constructor Details

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

Class Method Details

.typenameObject



69
# File 'lib/gorillib/type/extended.rb', line 69

def self.typename() :boolean_10 ; end

Instance Method Details

#convert(obj) ⇒ Object



72
73
74
75
76
77
78
# File 'lib/gorillib/type/extended.rb', line 72

def convert(obj)
  case obj.to_s
  when "0" then false
  when "1" then true
  else          super
  end
end