<commit_before>module Helium
  class User < Resource
    attr_reader :name, :email, :pending_invite
    alias_method :pending_invite?, :pending_invite

    def initialize(opts = {})
      super(opts)

      @name           = @params.dig('attributes', 'name')
      @email          = @params.dig('meta', 'email')
      @pending_invite = @params.dig('meta', 'pending_invite')
    end

    # TODO can probably generalize this a bit more
    def as_json
      super.merge({
        name: name,
        email: email
      })
    end
  end
end<commit_msg>add pending_invite to User json (#31)<commit_after>module Helium
  class User < Resource
    attr_reader :name, :email, :pending_invite
    alias_method :pending_invite?, :pending_invite

    def initialize(opts = {})
      super(opts)

      @name           = @params.dig('attributes', 'name')
      @email          = @params.dig('meta', 'email')
      @pending_invite = @params.dig('meta', 'pending_invite')
    end

    # TODO can probably generalize this a bit more
    def as_json
      super.merge({
        name: name,
        email: email,
        pending_invite: pending_invite
      })
    end
  end
end
{'fraction_non_alphanumeric': 0.11101549053356283, 'fraction_numerical': 0.0017211703958691911, 'mean_word_length': 2.4613095238095237, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '187806', 'n_tokens_mistral': 361, 'n_tokens_neox': 351, 'n_words': 92}