Class: Specwrk::BucketStore

Inherits:
Store
  • Object
show all
Defined in:
lib/specwrk/store/bucket_store.rb

Constant Summary collapse

EXAMPLES_KEY =
:____examples

Instance Method Summary collapse

Methods inherited from Store

#[], #[]=, adapter_klass, #any?, #delete, #empty?, #initialize, #inspect, #keys, #length, #merge!, #multi_read, #to_h, with_lock

Constructor Details

This class inherits a constructor from Specwrk::Store

Instance Method Details

#clearObject



23
24
25
26
# File 'lib/specwrk/store/bucket_store.rb', line 23

def clear
  @examples = nil
  super
end

#examplesObject



19
20
21
# File 'lib/specwrk/store/bucket_store.rb', line 19

def examples
  @examples ||= self[EXAMPLES_KEY] || []
end

#examples=(val) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/specwrk/store/bucket_store.rb', line 9

def examples=(val)
  @examples = nil

  self[EXAMPLES_KEY] = if val.nil? || val.length.zero?
    nil
  else
    val
  end
end

#reloadObject



28
29
30
31
# File 'lib/specwrk/store/bucket_store.rb', line 28

def reload
  @examples = nil
  super
end