Sha256: 6bf9d3d1d8ec5a0aa8158a045f0c77b4cca6e608f79106434619e24d98f5e3c1

Contents?: true

Size: 365 Bytes

Versions: 4

Compression:

Stored size: 365 Bytes

Contents

$LOAD_PATH.unshift '../lib'
require 'memory_record'

class A
  include MemoryRecord
  memory_record [
    { key: :foo },
  ]

  def name
    super.to_s.upcase
  end
end

class B < A
  memory_record_reset superclass.collect(&:attributes)

  def name
    "(#{super})"
  end
end

A.first.name                    # => "FOO"
B.first.name                    # => "(FOO)"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
memory_record-0.0.20 examples/0360_sub_class.rb
memory_record-0.0.19 examples/0360_sub_class.rb
memory_record-0.0.18 examples/0360_sub_class.rb
memory_record-0.0.17 examples/0360_sub_class.rb