Class: ActionSet::Instructions::EntryValue::ActiveModelAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/action_set/instructions/entry_value.rb

Instance Method Summary collapse

Constructor Details

#initialize(raw, target) ⇒ ActiveModelAdapter

Returns a new instance of ActiveModelAdapter.



60
61
62
63
# File 'lib/action_set/instructions/entry_value.rb', line 60

def initialize(raw, target)
  @raw = raw
  @target = target
end

Instance Method Details

#processObject



65
66
67
68
# File 'lib/action_set/instructions/entry_value.rb', line 65

def process
  return @raw if @raw.is_a? @target
  possible_values.find { |v| v.is_a? @target }
end