Skip to content

Commit

Permalink
Add syntactic sugar so we can also write `estimated_valuation(multipl…
Browse files Browse the repository at this point in the history
…e: 3)` (h/t @marckohlbrugge)
  • Loading branch information
rameerez committed Sep 1, 2024
1 parent aff6c46 commit 89d5e4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ Profitable.churn(in_the_last: 3.months).to_readable # => "12%"
# You can specify the precision of the output number (no decimals by default)
Profitable.new_mrr(in_the_last: 24.hours).to_readable(2) # => "$123.45"

# Get the estimated valuation at 5x ARR
Profitable.estimated_valuation(at: "5x").to_readable # => "$500,000"
# Get the estimated valuation at 5x ARR (defaults to 3x if no multiple is specified)
Profitable.estimated_valuation(multiple: 5).to_readable # => "$500,000"

# You can also pass the multiplier as a number, and/or ignore the "at:" keyword altogether
Profitable.estimated_valuation(4.5).to_readable # => "$450,000"
# You can also pass the multiplier as a string. You can also use the `at:` keyword argument (same thing as `multiplier:`) – and/or ignore the `at:` or `multiplier:` named arguments altogether
Profitable.estimated_valuation(at: "4.5x").to_readable # => "$450,000"

# Get the time to next MRR milestone
Profitable.time_to_next_mrr_milestone.to_readable # => "26 days left to $10,000 MRR"
Expand Down
4 changes: 2 additions & 2 deletions lib/profitable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def recurring_revenue_percentage(in_the_last: DEFAULT_PERIOD)
NumericResult.new(calculate_recurring_revenue_percentage(in_the_last), :percentage)
end

def estimated_valuation(multiplier = 3, at: nil)
actual_multiplier = at || multiplier
def estimated_valuation(multiplier = nil, at: nil, multiple: nil)
actual_multiplier = multiplier || at || multiple || 3
NumericResult.new(calculate_estimated_valuation(actual_multiplier))
end

Expand Down

0 comments on commit 89d5e4a

Please # to comment.