<commit_before>import generateActions from './actions';
import generateApi from './api';
import generateNames from './names';
import generateStore from './store';

/**
 * Base Flux resource class
 *
 * This isn't very useful by itself. Use the bindings for an actual Flux
 * framework.
 */
export default class FluxResource {
  constructor(options) {
    const {name, methodNames} = this.generateNames(options);
    this.name = name;
    this.methodNames = methodNames;

    this.fetch = this.getFetch(options);

    this.api = this.generateApi(options);
    this.actions = this.generateActions(options);
    this.store = this.generateStore(options);

    this.assignObject('Api', this.api);
    this.assignObject('Actions', this.actions);
    this.assignObject('Store', this.store);
  }

  generateNames(options) {
    return this::generateNames(options);
  }

  getFetch() {
    throw new Error('not implemented');
  }

  generateApi(options) {
    return this::generateApi(options);
  }

  generateDispatch() {
    throw new Error('not implemented');
  }

  generateActions(options) {
    return this::generateActions(options);
  }

  generateStore(options) {
    return this::generateStore(options);
  }

  assignObject(suffix, object) {
    const objectName = `${this.name}${suffix}`;

    object.displayName = objectName;
    this[objectName] = object;
  }
}
<commit_msg>Clean up name field assignments<commit_after>import generateActions from './actions';
import generateApi from './api';
import generateNames from './names';
import generateStore from './store';

/**
 * Base Flux resource class
 *
 * This isn't very useful by itself. Use the bindings for an actual Flux
 * framework.
 */
export default class FluxResource {
  constructor(options) {
    Object.assign(this, this.generateNames(options));

    this.fetch = this.getFetch(options);

    this.api = this.generateApi(options);
    this.actions = this.generateActions(options);
    this.store = this.generateStore(options);

    this.assignObject('Api', this.api);
    this.assignObject('Actions', this.actions);
    this.assignObject('Store', this.store);
  }

  generateNames(options) {
    return this::generateNames(options);
  }

  getFetch() {
    throw new Error('not implemented');
  }

  generateApi(options) {
    return this::generateApi(options);
  }

  generateDispatch() {
    throw new Error('not implemented');
  }

  generateActions(options) {
    return this::generateActions(options);
  }

  generateStore(options) {
    return this::generateStore(options);
  }

  assignObject(suffix, object) {
    const objectName = `${this.name}${suffix}`;

    object.displayName = objectName;
    this[objectName] = object;
  }
}

{'fraction_non_alphanumeric': 0.13077207240487626, 'fraction_numerical': 0.0, 'mean_word_length': 3.9147005444646097, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5766631', 'n_tokens_mistral': 795, 'n_tokens_neox': 768, 'n_words': 182}