Sha256: a532769c3074c3c945663a4705a274d72976ef86b035f78a1c90d5af2e59a5c6

Contents?: true

Size: 650 Bytes

Versions: 46

Compression:

Stored size: 650 Bytes

Contents

#
# A Component is a part of an Item; the principal content-bearing repository resource.
#
# Examples: Page of a book, track of a recording, etc.
#
class Component < Ddr::Models::Base

  include Ddr::Models::HasContent
  include Ddr::Models::HasMultiresImage
  include Ddr::Models::HasStructMetadata

  belongs_to :parent, :property => :is_part_of, :class_name => 'Item'
  belongs_to :target, :property => :has_external_target, :class_name => 'Target'

  alias_method :item, :parent
  alias_method :item=, :parent=

  def collection
    self.parent.parent rescue nil
  end

  def collection_uri
    self.collection.internal_uri rescue nil
  end

end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
ddr-models-2.4.7 app/models/component.rb
ddr-models-2.4.6 app/models/component.rb
ddr-models-2.4.5 app/models/component.rb
ddr-models-2.4.4 app/models/component.rb
ddr-models-2.4.3 app/models/component.rb
ddr-models-2.4.2 app/models/component.rb
ddr-models-2.4.1 app/models/component.rb
ddr-models-2.4.0 app/models/component.rb
ddr-models-2.4.0.rc6 app/models/component.rb
ddr-models-2.4.0.rc5 app/models/component.rb
ddr-models-2.4.0.rc4 app/models/component.rb
ddr-models-2.4.0.rc3 app/models/component.rb
ddr-models-2.4.0.rc2 app/models/component.rb
ddr-models-2.4.0.rc1 app/models/component.rb
ddr-models-2.3.2 app/models/component.rb
ddr-models-2.3.1 app/models/component.rb
ddr-models-2.3.0 app/models/component.rb
ddr-models-2.2.0 app/models/component.rb
ddr-models-2.1.3 app/models/component.rb
ddr-models-2.1.2 app/models/component.rb