lib/apia/polymorph.rb
# Return the type which should be returned for the given value by running
# through each of the matchers to find the appropriate type.
Return the type which should be returned for the given value by running
through each of the matchers to find the appropriate type.
Return the type which should be returned for the given value by running through each of the matchers to find the appropriate type .
def option_for_value(value)
        option = definition.options.values.find do |opt|
          opt.matches?(value)
        end
        if option.nil?
          raise InvalidPolymorphValueError.new(self, value)
        end
        option
      end
def option_for_value ( value ) option = definition . options . values . find do | opt | opt . matches? ( value ) end if option . nil? raise InvalidPolymorphValueError . new ( self , value ) end option end
Return the type which should be returned for the given value by running
through each of the matchers to find the appropriate type.
Return the type which should be returned for the given value by running through each of the matchers to find the appropriate type .
value
<not_specific>