Class: ValidateableHash

Inherits:
Hash
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/validates_serialized/validateable_hash.rb

Instance Method Summary collapse

Methods included from ActiveModel::Validations

#validates_array_values_with, #validates_hash_values_with, #validates_serialized_with!

Constructor Details

#initialize(hash) ⇒ ValidateableHash

Returns a new instance of ValidateableHash.



6
7
8
# File 'lib/validates_serialized/validateable_hash.rb', line 6

def initialize(hash)
  @hash = hash
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



11
12
13
14
# File 'lib/validates_serialized/validateable_hash.rb', line 11

def method_missing(method, *args, &block)
  # Delegate all methods to access the hash
  @hash[method]
end