Method: Vedeu::Common#become

Defined in:
lib/vedeu/common.rb

#become(klass, attributes) ⇒ Class

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Converts one class into another.

Parameters:

  • klass (Class)

    The class to become an instance of.

  • attributes (Hash)

    The attributes of klass.

Returns:

  • (Class)

    Returns a new instance of klass.



25
26
27
# File 'lib/vedeu/common.rb', line 25

def become(klass, attributes)
  klass.new(attributes)
end