Class: ActiveEntity::ConversionDefinitions

Inherits:
Object
  • Object
show all
Defined in:
lib/active_entity/conversion_definitions.rb

Defined Under Namespace

Classes: MapWithNormalizing

Class Method Summary collapse

Class Method Details

.get(type) ⇒ Proc

Parameters:

  • type (Class, Symbol, String)

Returns:

  • (Proc)


6
7
8
# File 'lib/active_entity/conversion_definitions.rb', line 6

def get(type)
  type_casting_procs.get(type)
end

.run_with_new_then_restorenil

Run block with new type_casting_procs. For test purpose.

Returns:

  • (nil)


18
19
20
21
22
23
# File 'lib/active_entity/conversion_definitions.rb', line 18

def run_with_new_then_restore
  old, @type_casting_procs = type_casting_procs, MapWithNormalizing.new
  yield
  @type_casting_procs = old
  nil
end

.set(type, &block) ⇒ Proc

Parameters:

  • type (Class, Symbol, String)

Returns:

  • (Proc)


12
13
14
# File 'lib/active_entity/conversion_definitions.rb', line 12

def set(type, &block)
  type_casting_procs.set(type, &block)
end