Module: StrictMoney::Orms::Mongoid::Amount

Included in:
Amount
Defined in:
lib/strict_money/orms/mongoid/amount.rb

Overview

Extend StrictMoney::Amount to work with Mongoid.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



10
11
12
13
14
# File 'lib/strict_money/orms/mongoid/amount.rb', line 10

def self.included(base)
  def base.demongoize(object)
    StrictMoney.demongoize_amount(object)
  end
end

Instance Method Details

#mongoizeObject



6
7
8
# File 'lib/strict_money/orms/mongoid/amount.rb', line 6

def mongoize
  {'currency' => @currency, 'amount' => @amount}
end