Sha256: 94cb28da2ef44694101ec1562e9dec75f04298f48bbd518293eece523438df7c

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Abstract
# Set: Abstract (VirtualCache)
#
# -*- encoding : utf-8 -*-
module VirtualCache;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/virtual/set/abstract/virtual_cache.rb"; end

def virtual?
  true
end

def history?
  false
end

def followable?
  false
end

def db_content
  Card::Virtual.fetch_content(self)
end

# called to refresh the virtual content
# the default way is to use the card's template content
def generate_virtual_content
  template&.db_content
end

event :save_virtual_content, :prepare_to_store, on: :save, changed: :content do
  Card::Virtual.create_or_update(self, attributes["db_content"])
  abort :success
end

event :delete_virtual_content, :prepare_to_store, on: :delete do
  Card::Virtual.find_by_card(self)&.delete
  abort :success
end

def delete
  # delete although it's new
  update trash: true
end

def delete!
  # delete although it's new
  update! trash: true
end
end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card/mod/virtual/set/abstract/virtual_cache.rb ~~

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
card-1.99.4 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb
card-1.99.3 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb
card-1.99.2 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb
card-1.99.1 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb
card-1.99.0 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb
card-1.98.3 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb
card-1.98.2 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb
card-1.98.1 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb
card-1.98.0 tmpsets/set/mod004-virtual/abstract/virtual_cache.rb