<commit_before>require 'ostruct'

# Public: Talks offered the previous week at the conf.
class Confs::Talk
  include Comparable

  def id
    slug
  end

  # Initializes an Talk.
  #
  # resource - An Hyperclient::Resource representing an Talk.
  def initialize(resource)
    @attributes = OpenStruct.new(resource.attributes.to_hash)
    @embedded = OpenStruct.new(resource.embedded.to_hash)
  end

  # Internal: Redirects all methods to the OpenStruct that has all the
  # attributes.
  def method_missing(method, *args, &block)
    @attributes.send(method, *args, &block)
  end

  # Internal: A method so jobs can be sorted alphabetically (using the
  # name)
  def <=>(other)
    self.date <=> other.date
  end

  # Internal: Compares two jobs by their id.
  def ==(other)
    self.id == other.id
  end
end
<commit_msg>Add attr_reader for embedded in talks<commit_after>require 'ostruct'

# Public: Talks offered the previous week at the conf.
class Confs::Talk
  include Comparable

  attr_reader :embedded

  def id
    slug
  end

  # Initializes an Talk.
  #
  # resource - An Hyperclient::Resource representing an Talk.
  def initialize(resource)
    @attributes = OpenStruct.new(resource.attributes.to_hash)
    @embedded = OpenStruct.new(resource.embedded.to_hash)
  end

  # Internal: Redirects all methods to the OpenStruct that has all the
  # attributes.
  def method_missing(method, *args, &block)
    @attributes.send(method, *args, &block)
  end

  # Internal: A method so jobs can be sorted alphabetically (using the
  # name)
  def <=>(other)
    self.date <=> other.date
  end

  # Internal: Compares two jobs by their id.
  def ==(other)
    self.id == other.id
  end
end

{'fraction_non_alphanumeric': 0.09273479031305375, 'fraction_numerical': 0.0, 'mean_word_length': 3.469656992084433, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7011960', 'n_tokens_mistral': 545, 'n_tokens_neox': 524, 'n_words': 177}