Class: Gorillib::Factory::StringFactory

Inherits:
ConvertingFactory show all
Defined in:
lib/gorillib/model/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)


215
# File 'lib/gorillib/model/factories.rb', line 215

def blankish?(obj)    obj.nil?                 end

#convert(obj) ⇒ Object



217
# File 'lib/gorillib/model/factories.rb', line 217

def convert(obj)      String(obj)              end

#native?(obj) ⇒ Boolean

Returns:

  • (Boolean)


216
# File 'lib/gorillib/model/factories.rb', line 216

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