class HashCast::Casters::HashCast

Public Class Methods

cast(value, attr_name, options = {}) click to toggle source
# File lib/hashcast/casters/hash_caster.rb, line 3
def self.cast(value, attr_name, options = {})
  return value if value.is_a?(Hash)
  raise HashCast::Errors::CastingError, "should be a hash"
end