Skip to content

Commit 89d5e4a

Browse files
committed
Add syntactic sugar so we can also write estimated_valuation(multiple: 3) (h/t @marckohlbrugge)
1 parent aff6c46 commit 89d5e4a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ Profitable.churn(in_the_last: 3.months).to_readable # => "12%"
100100
# You can specify the precision of the output number (no decimals by default)
101101
Profitable.new_mrr(in_the_last: 24.hours).to_readable(2) # => "$123.45"
102102

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

106-
# You can also pass the multiplier as a number, and/or ignore the "at:" keyword altogether
107-
Profitable.estimated_valuation(4.5).to_readable # => "$450,000"
106+
# 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
107+
Profitable.estimated_valuation(at: "4.5x").to_readable # => "$450,000"
108108

109109
# Get the time to next MRR milestone
110110
Profitable.time_to_next_mrr_milestone.to_readable # => "26 days left to $10,000 MRR"

lib/profitable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def recurring_revenue_percentage(in_the_last: DEFAULT_PERIOD)
4646
NumericResult.new(calculate_recurring_revenue_percentage(in_the_last), :percentage)
4747
end
4848

49-
def estimated_valuation(multiplier = 3, at: nil)
50-
actual_multiplier = at || multiplier
49+
def estimated_valuation(multiplier = nil, at: nil, multiple: nil)
50+
actual_multiplier = multiplier || at || multiple || 3
5151
NumericResult.new(calculate_estimated_valuation(actual_multiplier))
5252
end
5353

0 commit comments

Comments
 (0)