Class: Lycra::Types::Hash

Inherits:
Type
  • Object
show all
Defined in:
lib/lycra/types.rb

Instance Attribute Summary

Attributes inherited from Type

#value

Class Method Summary collapse

Methods inherited from Type

#initialize, klasses, to_s, transform, #transform, type, #type, #valid?

Constructor Details

This class inherits a constructor from Lycra::Types::Type

Class Method Details

.valid?(value, required = false, nested = false) ⇒ Boolean

Returns:



104
105
106
107
# File 'lib/lycra/types.rb', line 104

def self.valid?(value, required=false, nested=false)
  return true if super(value, required, nested)
  value.is_a?(Hash) || value.respond_to?(:to_h)
end