Last active
April 18, 2018 13:55
-
-
Save rafaellima/0b46fb2bcf3842411dfbb5fa55a3f4d0 to your computer and use it in GitHub Desktop.
deal playground
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
def module Domain::DealCreator | |
def new(params) | |
@deal = Deal.new(deal) | |
end | |
def save(deal_params) | |
deal = Deal.new(deal) | |
default_time | |
info | |
more | |
deal.save! | |
end | |
private | |
attr_reader :deal | |
def info | |
deal.information += "..." | |
end | |
def more | |
deal.more.replace(" ", ".") | |
end | |
def default_time | |
deal.closing_date_probability = (Time.zone.today + 30.days).strftime('%d/%m/%Y') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment