Module: MemModel::Guid::ClassMethods
- Defined in:
- lib/mem_model/guid.rb
Instance Method Summary collapse
Instance Method Details
#find_all_matching(substring) ⇒ Object
16 17 18 |
# File 'lib/mem_model/guid.rb', line 16 def find_all_matching(substring) store.select{ |r| r.id.include?(substring.to_s.upcase) } end |
#generate_id ⇒ Object
8 9 10 |
# File 'lib/mem_model/guid.rb', line 8 def generate_id [guid_prefix, '-', SecureRandom.uuid].join.upcase end |
#guid_prefix ⇒ Object
12 13 14 |
# File 'lib/mem_model/guid.rb', line 12 def guid_prefix name[0...3] end |