<commit_before>/**
 * Created by István on 10/8/2015.
 */
(function () {
  'use strict';

  angular
    .module('app')
    .factory('firebaseService', firebaseService);

  firebaseService.$inject = ['$log', '$firebaseArray', '$firebaseObject'];

  /* @ngInject */
  function firebaseService($log, $firebaseArray, $firebaseObject) {
    var baseURL = "https://netbakery.firebaseio.com";
    var firebaseReference = new Firebase(baseURL);

    var service = {
      getArray: getArray,
      getObject: getObject,
      getReference: getReference
    };
    return service;

    ////////////////

    function getReference(){
      return firebaseReference;
    }

    function getArray(url){
      var currentReference = firebaseReference.child(url);
      $log.info('Getting array for path: ' + currentReference.toString());
      return $firebaseArray(currentReference);
    }

    function getObject(url){
      var currentReference = firebaseReference.child(url);
      $log.info('Getting object for path: ' + currentReference.toString());
      return $firebaseObject(currentReference);
    }
  }

})();
<commit_msg>added update function<commit_after>/**
 * Created by István on 10/8/2015.
 */
(function () {
  'use strict';

  angular
    .module('app')
    .factory('firebaseService', firebaseService);

  firebaseService.$inject = ['$log', '$firebaseArray', '$firebaseObject'];

  /* @ngInject */
  function firebaseService($log, $firebaseArray, $firebaseObject) {
    var baseURL = "https://netbakery.firebaseio.com";
    var firebaseReference = new Firebase(baseURL);

    var service = {
      getArray: getArray,
      getObject: getObject,
      getReference: getReference,
      updateObject: updateObject
    };
    return service;

    ////////////////

    function getReference(){
      return firebaseReference;
    }

    function getArray(url){
      var currentReference = firebaseReference.child(url);
      $log.info('Getting array for path: ' + currentReference.toString());
      return $firebaseArray(currentReference);
    }

    function getObject(url){
      var currentReference = firebaseReference.child(url);
      $log.info('Getting object for path: ' + currentReference.toString());
      return $firebaseObject(currentReference);
    }

    function updateObject(url){
      var currentReference = firebaseReference.child(url);
      $log.info('Updating object for path: ' + currentReference.toString());
      currentReference.update(obj)
    }

  }

})();

{'fraction_non_alphanumeric': 0.13959085439229843, 'fraction_numerical': 0.005615724027276374, 'mean_word_length': 3.2128378378378377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2752253', 'n_tokens_mistral': 729, 'n_tokens_neox': 700, 'n_words': 149}