module Quovo::Refinements::Cast

Public Instance Methods

cast(model) click to toggle source
# File lib/quovo/refinements/cast.rb, line 5
def cast(model)
  case self
  when Hash
    model.new(self)
  when Array
    map do |entry|
      entry.cast(model)
    end
  when NilClass
    nil
  else
    raise 'unknown source type for casting'
  end
end