Class: ActionSet::AttributeValue::PlainRubyAdapter
- Inherits:
-
Object
- Object
- ActionSet::AttributeValue::PlainRubyAdapter
- Defined in:
- lib/action_set/attribute_value.rb
Instance Method Summary collapse
-
#initialize(raw, target) ⇒ PlainRubyAdapter
constructor
A new instance of PlainRubyAdapter.
- #process ⇒ Object
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
#process ⇒ Object
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 |