lib/codestrap/strap/factory.rb
# Dynamic Class creation.
# Looks for Classes in Codestrap::Strap::NKLASS
#
# @param [String|Symbol] nklass
#   Look for Codestrap::Template::nklass
# @raise [FactoryArgumentError]
#   Raised if nklass is not type String or type Symbol
# @return [Codestrap::Stub::KLASS]
#   Return class Codestrap::Template::KLASS
Dynamic Class creation.
Looks for Classes in Codestrap::Strap::NKLASS
Dynamic Class creation . Looks for Classes in Codestrap :: Strap :: NKLASS
def to_class nklass
        case
          when nklass.is_a?(Symbol)
            klass = nklass.to_s
          when nklass.is_a?(String)
            klass = nklass
          else
            raise ArgumentError, %Q(Could not find Class Codestrap::Strap::#{nklass.to_s})
        end
        @klass = ['Codestrap', 'Strap', klass].reduce(Module, :const_get)
        @klass
      end
def to_class nklass case when nklass . is_a? ( Symbol ) klass = nklass . to_s when nklass . is_a? ( String ) klass = nklass else raise ArgumentError , %Q(Could not find Class Codestrap::Strap::#{nklass.to_s}) end @klass = [ 'Codestrap' , 'Strap' , klass ] . reduce ( Module , :const_get ) @klass end
Dynamic Class creation.
Dynamic Class creation .
Return class Codestrap::Template::KLASS
Return class Codestrap :: Template :: KLASS
Codestrap::Stub::KLASS
[FactoryArgumentError] Raised if nklass is not type String or type Symbol
[ FactoryArgumentError ] Raised if nklass is not type String or type Symbol
nklass
nklass Look for Codestrap::Template::nklass
nklass Look for Codestrap :: Template :: nklass