<commit_before>//
//  ConfirmationAlertViewModel.swift
//  SonicWords
//
//  Created by <NAME> on 5/18/16.
//  Copyright © 2016 Wolox. All rights reserved.
//

import Foundation

/// ConfirmationAlertViewModel models a `UIAlertController` where there are
/// two options to select:
///
/// * confirmAction: normally a action that do something.
/// * dismissAction: normally a empty action.
public struct ConfirmationAlertViewModel {
    
    public let title: String
    public let message: String
    public let dismissButtonTitle: String
    public let confirmButtonTitle: String
    public let dismissAction: ConfirmationAlertViewModel -> ()
    public let confirmAction: ConfirmationAlertViewModel -> ()
    
    /// Initialize a new ConfirmationAlertViewModel with the provided parameters.
    ///
    /// Is not necessary to provide all parameters. In most cases, is only
    /// needed `title`, `message` and `confirmAtion`.
    ///
    /// - parameter title: The alert title.
    /// - parameter message: The alert message.
    /// - parameter dismissButtonTitle: The dismiss button title.
    /// - parameter dismissAction: The dismiss button action.
    /// - parameter confirmButtonTitle: The confirm button title.
    /// - parameter confirmAction: The confirm button action.
    public init(
        title: String,
        message: String,
        dismissButtonTitle: String = "confirmation-alert-view.dismiss.title".localized,
        dismissAction: ConfirmationAlertViewModel -> () = { _ in },
        confirmButtonTitle: String = "confirmation-alert-view.confirm.title".localized,
        confirmAction: ConfirmationAlertViewModel -> () = { _ in }) {
        self.title = title
        self.message = message
        self.confirmAction = confirmAction
        self.dismissAction = dismissAction
        self.dismissButtonTitle = dismissButtonTitle
        self.confirmButtonTitle = confirmButtonTitle
    }
    
}<commit_msg>Alerts: default titles for dismiss and confirm buttons<commit_after>//
//  ConfirmationAlertViewModel.swift
//  SonicWords
//
//  Created by <NAME> on 5/18/16.
//  Copyright © 2016 Wolox. All rights reserved.
//

import Foundation

/**
 ConfirmationAlertViewModel models a `UIAlertController` where there are
 two options to select:

 * confirmAction: normally a action that do something.
 * dismissAction: normally a empty action.
*/
public struct ConfirmationAlertViewModel {
    
    public let title: String
    public let message: String
    public let dismissButtonTitle: String
    public let confirmButtonTitle: String
    public let dismissAction: ConfirmationAlertViewModel -> ()
    public let confirmAction: ConfirmationAlertViewModel -> ()
    
    /**
    Initialize a new ConfirmationAlertViewModel with the provided parameters.
    
    Is not necessary to provide all parameters. In most cases, is only
    needed `title`, `message` and `confirmAtion`.
    
    - parameter title: The alert title.
    - parameter message: The alert message.
    - parameter dismissButtonTitle: The dismiss button title.
    - parameter dismissAction: The dismiss button action.
    - parameter confirmButtonTitle: The confirm button title.
    - parameter confirmAction: The confirm button action.
    */
    public init(
        title: String,
        message: String,
        dismissButtonTitle: String = DefaultConfirmButtonTitle,
        dismissAction: ConfirmationAlertViewModel -> () = { _ in },
        confirmButtonTitle: String = DefaultDismissButtonTitle,
        confirmAction: ConfirmationAlertViewModel -> () = { _ in }) {
        self.title = title
        self.message = message
        self.confirmAction = confirmAction
        self.dismissAction = dismissAction
        self.dismissButtonTitle = dismissButtonTitle
        self.confirmButtonTitle = confirmButtonTitle
    }
    
    public static var DefaultConfirmButtonTitle: String = "confirmation-alert-view.dismiss.title".localized
    
    public static var DefaultDismissButtonTitle: String = "confirmation-alert-view.confirm.title".localized
}
{'fraction_non_alphanumeric': 0.08298448657966018, 'fraction_numerical': 0.004432405811376508, 'mean_word_length': 2.998031496062992, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2763887', 'n_tokens_mistral': 1030, 'n_tokens_neox': 986, 'n_words': 331}