Class: AssociateJsonb::WithStoreAttribute::StoreColumnAttributeTracker

Inherits:
Module
  • Object
show all
Includes:
Mutex_m
Defined in:
lib/associate_jsonb/with_store_attribute.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#add_name(name, store, key, cast) ⇒ Object



15
16
17
# File 'lib/associate_jsonb/with_store_attribute.rb', line 15

def add_name(name, store, key, cast)
  names_list[name.to_s.freeze] = { store: store, key: key, cast: cast }
end

#get(name) ⇒ Object



23
24
25
# File 'lib/associate_jsonb/with_store_attribute.rb', line 23

def get(name)
  names_list[name.to_s]
end

#has_name?(name) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/associate_jsonb/with_store_attribute.rb', line 19

def has_name?(name)
  names_list.key? name.to_s
end

#key_for(name) ⇒ Object



31
32
33
# File 'lib/associate_jsonb/with_store_attribute.rb', line 31

def key_for(name)
  (get(name) || {})[:key]
end

#names_listObject



11
12
13
# File 'lib/associate_jsonb/with_store_attribute.rb', line 11

def names_list
  @names_list ||= {}
end

#store_for(name) ⇒ Object



27
28
29
# File 'lib/associate_jsonb/with_store_attribute.rb', line 27

def store_for(name)
  (get(name) || {})[:store]
end