<commit_before>/**
 * Created by chiwe_000 on 6/9/2016.
 */<commit_msg>https://app.asana.com/0/117435667927162/118836678397143 Wrote service for breweries<commit_after>/**
 * Created by chiwe_000 on 6/9/2016.
 */

app.constant("BREWERY_ENDPOINT", "php/apis/brewery/");
app.service("breweryService", function($http, BREWERY_ENDPOINT) {

	function getUrl() {
		return(BREWERY_ENDPOINT);
	}

	function getUrlForId(breweryId) {
		return(getUrl() + breweryId);
	}

	this.all = function() {
		return($http.get(getUrl()));
	};

	this.fetchBreweryById = function(breweryId) {
		return($http.get(getUrlForId() + scheduleId));
	};

	this.fetchBreweryByLocation = function(breweryLocation) {
		return($http.get(getUrl() + "?breweryLocation=" + breweryLocation));
	};

	this.fetchBreweryByName = function(breweryName) {
		return($http.get(getUrl() + "?breweryName=" + breweryName));
	};


	this.update = function(breweryId, brewery) {
		return($http.put(getUrlForId(breweryId, brewery)));
	};

	this.create = function(brewery) {
		return($http.post(getUrl(), brewery));
	};

	this.destroy = function(breweryId) {
		return($http.delete(getUrlForId(breweryhId)));
	};
});

{'fraction_non_alphanumeric': 0.17443868739205526, 'fraction_numerical': 0.04231433506044905, 'mean_word_length': 5.403314917127072, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3219762', 'n_tokens_mistral': 478, 'n_tokens_neox': 420, 'n_words': 57}