Sha256: d94d25880449cdc1a484716068279f3f1fc7312e3ae6cfc6c488bea583631aaa

Contents?: true

Size: 947 Bytes

Versions: 17

Compression:

Stored size: 947 Bytes

Contents

class Canvas
  include Mongoid::Document
  field :name
  has_many :shapes
  has_one :writer

  def render
    shapes.each { |shape| render }
  end
end

class Browser < Canvas
  field :version, :type => Integer
  def render; end
end

class Firefox < Browser
  field :user_agent
  def render; end
end

class Shape
  include Mongoid::Document
  field :x, :type => Integer, :default => 0
  field :y, :type => Integer, :default => 0

  belongs_to :canvas, :inverse_of => :shapes

  def render; end
end

class Square < Shape
  field :width, :type => Integer, :default => 0
  field :height, :type => Integer, :default => 0
end

class Circle < Shape
  field :radius, :type => Integer, :default => 0
end

class Writer
  include Mongoid::Document
  field :speed, :type => Integer, :default => 0

  belongs_to :canvas, :inverse_of => :writer

  def write; end
end

class HtmlWriter < Writer
  def write; end
end

class PdfWriter < Writer
  def write; end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
mongoid-1.2.14 spec/models/inheritance.rb
mongoid-1.2.13 spec/models/inheritance.rb
mongoid-1.2.12 spec/models/inheritance.rb
mongoid-1.2.11 spec/models/inheritance.rb
mongoid-1.2.10 spec/models/inheritance.rb
mongoid-1.2.9 spec/models/inheritance.rb
mongoid-1.2.8 spec/models/inheritance.rb
mongoid-1.2.7 spec/models/inheritance.rb
mongoid-pre-2.0.0.pre spec/models/inheritance.rb
mongoid-1.2.6 spec/models/inheritance.rb
mongoid-1.2.5 spec/models/inheritance.rb
mongoid-1.2.4 spec/models/inheritance.rb
mongoid-1.2.3 spec/models/inheritance.rb
mongoid-1.2.2 spec/models/inheritance.rb
mongoid-1.2.1 spec/models/inheritance.rb
mongoid-1.2.0 spec/models/inheritance.rb
mongoid-1.1.4 spec/models/inheritance.rb