require 'ostruct'

class RegisterableCalendar
  extend Forwardable

  attr_accessor :calendar, :slug, :live

  def_delegators :@calendar, :indexable_content, :content_id

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

  def title
    I18n.t(@calendar.title)
  end

  def description
    I18n.t(@calendar.description)
  end

  def state
    'live'
  end

  def need_ids
    [@calendar.need_id.to_s]
  end

  # Sending an empty array for `paths` and `prefixes` will make sure we don't
  # register routes in Panopticon.
  def paths
    []
  end

  def prefixes
    []
  end
end

require 'ostruct'

class RegisterableCalendar
  extend Forwardable

  attr_accessor :calendar, :slug

  def_delegators :@calendar, :indexable_content, :content_id

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

  def title
    I18n.t(@calendar.title)
  end

  def description
    I18n.t(@calendar.description)
  end
end

Remove unused method from registerable calendar
Remove unused method from registerable calendar

This class used to be used by both panopticon and rummager. Now that
panopticon is removed as a dependency
(https://github.com/alphagov/calendars/pull/135) these methods aren't
necessary anymore.
