Module: EntityCache::Controls::Store::External
- Defined in:
- lib/entity_cache/controls/store/external.rb,
lib/entity_cache/controls/store/external/write.rb,
lib/entity_cache/controls/store/external/example.rb,
lib/entity_cache/controls/store/external/not_implemented.rb
Defined Under Namespace
Modules: NotImplemented, Write
Classes: Example
Class Method Summary
collapse
Class Method Details
.example(subject = nil, entity_class: nil, specifier: nil, random: nil) ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/entity_cache/controls/store/external.rb', line 5
def self.example(subject=nil, entity_class: nil, specifier: nil, random: nil)
random = true if random.nil?
subject ||= Subject.example(random: random, entity_class: entity_class, specifier: specifier)
Example.build(subject)
end
|
.path(subject, id = nil) ⇒ Object
51
52
53
54
55
56
57
58
59
|
# File 'lib/entity_cache/controls/store/external/example.rb', line 51
def self.path(subject, id=nil)
id ||= ID.example
filename = "#{subject.to_s.gsub('/', '-')}-#{id}.yaml"
full_name = File.join(tmpdir, filename)
full_name
end
|
.tmpdir ⇒ Object
61
62
63
|
# File 'lib/entity_cache/controls/store/external/example.rb', line 61
def self.tmpdir
@tmpdir ||= Dir.tmpdir
end
|