Created
May 31, 2012 17:49
-
-
Save murphybytes/2845020 to your computer and use it in GitHub Desktop.
Hack for mongoid version differences
This file contains 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 self.npv_item_for_security_id sec_id, swap_prices | |
npv_items = swap_prices.npv_items.select do |item| | |
item['symbol'].eql?(sec_id) | |
end | |
return nil if npv_items.empty? | |
npv_item = npv_items.last | |
npv_item = npv_item.as_document unless npv_item.is_a?(Hash) | |
Java::Eris::NpvItem.from_h(npv_item) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment