diff options
| author | mo khan <mo@mokhan.ca> | 2014-05-22 21:42:41 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-05-22 21:42:41 -0600 |
| commit | 86e1e1a41eb976fa540fa5bd3119ac3db52515a1 (patch) | |
| tree | 01857c2b49e131e261ffc2a226aed9c1faf2df31 /lib/unit.rb | |
| parent | 4352386e538cc61a157f2d360cadda18ea04d682 (diff) | |
collapse a couple of methods using find_all.main
Diffstat (limited to 'lib/unit.rb')
| -rw-r--r-- | lib/unit.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/unit.rb b/lib/unit.rb index 32c9a4d..16e6456 100644 --- a/lib/unit.rb +++ b/lib/unit.rb @@ -19,12 +19,14 @@ end class UnvestedUnits def from(grant, at_price) - grant.value_of_unvested_units_at(at_price) + unvested_units = grant.find_all { |unit| unit.vested? == false } + grant.value_of(unvested_units, at_price) end end class VestedUnits def from(grant, at_price) - grant.value_of_vested_units_at(at_price) + vested_units = grant.find_all { |unit| unit.vested? } + grant.value_of(vested_units, at_price) end end |
