Method: Moneta::CreateSupport#create
- Defined in:
- lib/moneta/create_support.rb
#create(key, value, options = {}) ⇒ Boolean
Note:
Not every Moneta store implements this method, a NotImplementedError is raised if it is not supported.
Atomically sets a key to value if it’s not set.
8 9 10 11 12 13 14 15 |
# File 'lib/moneta/create_support.rb', line 8 def create(key, value, = {}) if key? key false else store(key, value, ) true end end |