Class: StoreModel::Types::Hash

Inherits:
HashBase
  • Object
show all
Defined in:
lib/store_model/types/hash.rb

Overview

Implements ActiveModel::Type::Value type for handling a hash of StoreModel::Model

Instance Attribute Summary

Attributes inherited from Base

#model_klass

Instance Method Summary collapse

Methods inherited from HashBase

#cast_value, #changed_in_place?, #serialize

Constructor Details

#initialize(model_klass) ⇒ StoreModel::Types::Hash

Initializes type for model class

Parameters:



15
16
17
18
# File 'lib/store_model/types/hash.rb', line 15

def initialize(model_klass)
  @model_klass = model_klass
  super()
end

Instance Method Details

#typeSymbol

Returns type

Returns:

  • (Symbol)


23
24
25
# File 'lib/store_model/types/hash.rb', line 23

def type
  :hash
end