require 'ostruct'

# Takes a path and produces a calendar object for registering in
# panopticon
class RegisterableCalendar
  extend Forwardable

  attr_accessor :calendar, :slug, :live

  def_delegators :@calendar, :title, :need_id, :description, :section

  def initialize(path)
    details = JSON.parse(File.read(path))
    @calendar = OpenStruct.new(details)
    @slug = File.basename(path, '.json')
  end

  def live
    true
  end
end

require 'ostruct'

# Takes a path and produces a calendar object for registering in
# panopticon
class RegisterableCalendar
  extend Forwardable

  attr_accessor :calendar, :slug, :live

  def_delegators :@calendar, :title, :need_id, :description, :section, :indexable_content

  def initialize(path)
    details = JSON.parse(File.read(path))
    @calendar = OpenStruct.new(details)
    @slug = File.basename(path, '.json')
  end

  def live
    true
  end
end

Add indexable_content to the registered fields.
Add indexable_content to the registered fields.

Including this field means Panopticon has all the data it needs to
post the artefact to Rummager directly, rather than having to post an
amendment, which will fail if the item is not already in Rummager's
index.
