<commit_before>//
//  ExploraUser.swift
//  Explora
//
//  Created by admin on 10/18/15.
//  Copyright © 2015 explora-codepath. All rights reserved.
//
/*
    User
    - username/email (already implemented by PFUser)
    - password (already implemented by PFUser)
    - facebook id?
    - array of event ids user has created
    - array of event ids user is participating in
*/

import UIKit
import Parse

protocol ExploraUser {
    var createdEvents: [String]? { get }
    var participatingEvents: [String]? { get }
}

extension PFUser : ExploraUser {
    // username
    // email
    // password
    
    var createdEvents: [String]? {
        get {
            return self["created_events"] as? [String]
        }
        set {
            self["created_events"] = newValue
        }
    }
    
    var participatingEvents: [String]? {
        get {
            return self["participating_events"] as? [String]
        }
        set {
            self["participating_events"] = newValue
        }
    }
}<commit_msg>[User] - update explora user model to include first name and picture url from facebook<commit_after>//
//  ExploraUser.swift
//  Explora
//
//  Created by admin on 10/18/15.
//  Copyright © 2015 explora-codepath. All rights reserved.
//
/*
    User
    - username/email (already implemented by PFUser)
    - password (already implemented by PFUser)
    - facebook id?
    - array of event ids user has created
    - array of event ids user is participating in
*/

import UIKit
import Parse

protocol ExploraUser {
    var createdEvents: [String]? { get }
    var participatingEvents: [String]? { get }
    var firstName: String? { get }
    var pictureURL: String? { get }
}

extension PFUser : ExploraUser {
    // username
    // email
    // password
    
    var createdEvents: [String]? {
        get {
            return self["created_events"] as? [String]
        }
        set {
            self["created_events"] = newValue
        }
    }
    
    var participatingEvents: [String]? {
        get {
            return self["participating_events"] as? [String]
        }
        set {
            self["participating_events"] = newValue
        }
    }
    
    var firstName: String? {
        get {
            return self["first_name"] as? String
        }
        set {
            self["first_name"] = newValue
        }
    }
    
    var pictureURL: String? {
        get {
            return self["picture_url"] as? String
        }
        set {
            self["picture_url"] = newValue
        }
    }
}
{'fraction_non_alphanumeric': 0.1026346834447503, 'fraction_numerical': 0.007864726700747149, 'mean_word_length': 1.8141592920353982, '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': '1041573', 'n_tokens_mistral': 761, 'n_tokens_neox': 725, 'n_words': 213}