Module: Prefatory::Keys
- Defined in:
- lib/prefatory/keys.rb
Constant Summary collapse
- INCR_KEY =
'prefatory'.freeze
Instance Method Summary collapse
Instance Method Details
#build_key(obj = nil, value = nil, prefix = nil) ⇒ Object
5 6 7 8 9 |
# File 'lib/prefatory/keys.rb', line 5 def build_key(obj=nil,value=nil, prefix=nil) klass = nil klass = obj&.class == 'Class' ? obj.name.downcase : obj&.class.name.downcase if obj "#{INCR_KEY}#{prefix ? ":#{prefix}" : nil}#{klass ? ":#{klass}" : nil}#{value ? ":#{value}" : nil}" end |