Sha256: 6be476a08da5d3aaca1138c6208241d174da88b9f015888f859afc7f279067aa
Contents?: true
Size: 531 Bytes
Versions: 7
Compression:
Stored size: 531 Bytes
Contents
module Bioshogi extend ActiveSupport::Concern concern :ApplicationMemoryRecord do included do include MemoryRecord def self.fetch(*) super rescue KeyError => error raise KeyNotFound, error.message end # fetch できなかったとき default_key が指すレコードを返す def self.safe_fetch(key) v = lookup(key) unless v v = fetch(default_key) end v end end def inspect "<#{key}>" end end end
Version data entries
7 entries across 7 versions & 1 rubygems