Class: ViewModel::ActiveRecord::FunctionalUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/view_model/active_record/update_data.rb

Defined Under Namespace

Classes: Append, Remove, Update

Class Method Summary collapse

Class Method Details

.for_type(type) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/view_model/active_record/update_data.rb', line 10

def self.for_type(type)
  case type
  when Append::NAME
    return Append
  when Remove::NAME
    return Remove
  when Update::NAME
    return Update
  else
    raise ArgumentError.new("invalid functional update type #{type}")
  end
end