This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-Crear una clase Auto, al instanciar un objeto de la clase dale la oportunidad al usuario de definir variables de instancia como año, color y modelo.También crea una variable de instancia seteada en 0 durante la instanciación del objeto para realizar un seguimiento de la velocidad actual del auto. Crear métodos de instancia que permitan al auto acelerar, frenar, y estacionar (apagar el auto, velocidad 0). | |
| #-Método de instancia de encender el auto, y métodos de obtener la marca y setear una marca. | |
| #-Añadir método accessor a la clase de autos para cambiar y ver el color de su auto. A continuación, añadir otro método accessor que | |
| #le permite ver, pero no modificar, el año de su auto | |
| car = Car.new(2013, :red, "Yaris") | |
| car.brand = "Toyota" | |
| puts car.brand | |
| puts car.color | |
| car.color = :green |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Crear un arreglo de hashes, cada hash contiene los datos de la persona: | |
| # - Nombre Completo | |
| # - País | |
| # - Continente | |
| # - Género | |
| # | |
| # Poblar con muchos datos | |
| # 2.- Contar la cantidad de personas de la lista | |
| # 3.- Generar un array con cada continente, eliminar repeticiones, considerar | |
| # que pueden haber nombres escritos con mayúscula y minúscula |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| before do | |
| @user = user_with(first_name: "Maria") | |
| @project_one = project_with( | |
| fixed_annual_rate: 11, | |
| execution_date: Date.new(2015, 10, 8), | |
| investments: [investment_with(amount: 100_000, user: user)]) | |
| end | |
| def project_with(attrs) | |
| FakeProject.new({ fixed_annual_rate: 11 }.merge(attrs)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it "(when project is refunded)" do | |
| portfolio = portfolio_on(Date.new(2018, 2, 4)) | |
| date = next_payment_date_for_project( | |
| portfolio, | |
| refunded_project, | |
| formatter: ->(date) { "My date: #{date}" }, | |
| not_executed_message: "No se ha ejecutado", | |
| no_payments_left_message: "No hay más pagos", | |
| project_refunded_message: "No aplica" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Admin::ProjectFundingTerminationsController < Admin::BaseController | |
| def destroy | |
| Projects.revert_funding_termination( | |
| find_project, | |
| projects_store: Project, | |
| receipts_cancelator: ReceiptsCancelator | |
| ) | |
| redirect_to admin_projects_path | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Admin::ProjectFundingTerminationsController < Admin::BaseController | |
| def new | |
| project = find_project | |
| form = Projects.terminate_funding_form(project) | |
| render locals: { project: project, form: form }, layout: false | |
| end | |
| def create | |
| termination = Projects.terminate_funding( | |
| find_project.id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Projects | |
| def self.publish_project | |
| end | |
| def self.add_termination_date_form | |
| end | |
| def self.add_termination_date | |
| end | |
| def self.details_page_for_project | |
| end | |
| def self.terminate_funding_form |