Module: RegistorCallbacks::ClassMethods
- Defined in:
- lib/registor/registor_callbacks.rb
Overview
self.included
Instance Method Summary collapse
- #current_uniq_id_value ⇒ Object
- #regist_uniq_id ⇒ Object
- #regist_uniq_name(field_name, name) ⇒ Object
- #rem_uniq_name(field_name, name) ⇒ Object
- #uniq_name_count(field_name) ⇒ Object
Instance Method Details
#current_uniq_id_value ⇒ Object
15 16 17 |
# File 'lib/registor/registor_callbacks.rb', line 15 def current_uniq_id_value RegistorConf.redis.get("#{RegistorConf.name_space}:#{self.name}:uniq_id") end |
#regist_uniq_id ⇒ Object
11 12 13 |
# File 'lib/registor/registor_callbacks.rb', line 11 def regist_uniq_id RegistorConf.redis.incr("#{RegistorConf.name_space}:#{self.name}:uniq_id") end |
#regist_uniq_name(field_name, name) ⇒ Object
19 20 21 |
# File 'lib/registor/registor_callbacks.rb', line 19 def regist_uniq_name(field_name, name) RegistorConf.redis.sadd "#{RegistorConf.name_space}:#{self.name}:#{field_name}", name end |
#rem_uniq_name(field_name, name) ⇒ Object
27 28 29 |
# File 'lib/registor/registor_callbacks.rb', line 27 def rem_uniq_name(field_name, name) RegistorConf.redis.srem "#{RegistorConf.name_space}:#{self.name}:#{field_name}", name end |
#uniq_name_count(field_name) ⇒ Object
23 24 25 |
# File 'lib/registor/registor_callbacks.rb', line 23 def uniq_name_count(field_name) RegistorConf.redis.scard "#{RegistorConf.name_space}:#{self.name}:#{field_name}" end |