Class: ActionSet::AttributeValue::PlainRubyAdapter

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

Instance Method Summary collapse

Constructor Details

#initialize(raw, target) ⇒ PlainRubyAdapter

Returns a new instance of PlainRubyAdapter.



29
30
31
32
# File 'lib/action_set/attribute_value.rb', line 29

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

Instance Method Details

#processObject



34
35
36
37
38
# File 'lib/action_set/attribute_value.rb', line 34

def process
  return @raw if @raw.is_a? @target

  possible_values.find { |v| v.is_a? @target }
end