Class: Gorillib::Factory::StringFactory

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

Overview


Concrete Factories


Instance Method Summary collapse

Methods inherited from ConvertingFactory

#receive

Methods inherited from BaseFactory

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

Constructor Details

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

Instance Method Details

#blankish?(obj) ⇒ Boolean

Returns:

  • (Boolean)


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

def blankish?(obj)    obj.nil?                 end

#convert(obj) ⇒ Object



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

def convert(obj)      String(obj)              end

#native?(obj) ⇒ Boolean

Returns:

  • (Boolean)


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

def native?(obj)      obj.respond_to?(:to_str) end