Permalink
Browse files

Fix some YARD for API documents

Fix YARD for Money::Currency#symbol_first

Fix YARD for Money::Formatting#format

Fix YARD for Money::Formatting#normalize_formatting_rules

Fix YARD for Money::Parsing::ClassMethods#parse

Fix YARD for Money::Parsing::ClassMethods#from_string

Fix YARD for Money::Parsing::ClassMethods#from_numeric

Fix YARD for Money::Parsing::ClassMethods#from_fixnum

Fix YARD for Money::Parsing::ClassMethods#from_float

Fix YARD for Money::Parsing::ClassMethods#from_bigdecimal

Fix YARD for Money#initialize

Fix YARD for Money#allocate

Fix YARD for Money#split
  • Loading branch information...
1 parent 91c50d0 commit b96ef9237e9c4cabab6c7b43df98edb4f951cbb3 @kachick kachick committed Mar 25, 2013
Showing with 17 additions and 17 deletions.
  1. +1 −1 lib/money/currency.rb
  2. +3 −3 lib/money/money.rb
  3. +2 −2 lib/money/money/formatting.rb
  4. +11 −11 lib/money/money/parsing.rb
View
@@ -180,7 +180,7 @@ def stringify_keys
# Should the currency symbol precede the amount, or should it come after?
#
- # @return [boolean]
+ # @return [Boolean]
attr_reader :symbol_first
# Create a new +Currency+ object.
View
@@ -221,7 +221,7 @@ def self.add_rate(from_currency, to_currency, rate)
# Alternatively you can use the convenience
# methods like {Money.ca_dollar} and {Money.us_dollar}.
#
- # @param [Integer] The value given in the fractional unit.
+ # @param [Numeric] fractional The value given in the fractional unit.
# @param [Currency, String, Symbol] currency The currency format.
# @param [Money::Bank::*] bank The exchange bank to use.
#
@@ -468,7 +468,7 @@ def as_euro
# be distributed round-robin amongst the parties. This means that parties
# listed first will likely recieve more pennies then ones that are listed later
#
- # @param [0.50, 0.25, 0.25] to give 50% of the cash to party1, 25% ot party2, and 25% to party3.
+ # @param [Array<Float, Float, Float>] splits [0.50, 0.25, 0.25] to give 50% of the cash to party1, 25% to party2, and 25% to party3.
#
# @return [Array<Money, Money, Money>]
#
@@ -506,7 +506,7 @@ def allocate(splits)
# Split money amongst parties evenly without loosing pennies.
#
- # @param [2] number of parties.
+ # @param [Numeric] num number of parties.
#
# @return [Array<Money, Money, Money>]
#
@@ -47,7 +47,7 @@ def decimal_mark
# Creates a formatted price string according to several rules.
#
- # @param [Hash] *rules The options used to format the string.
+ # @param [Hash] rules The options used to format the string.
#
# @return [String]
#
@@ -268,7 +268,7 @@ def format(*rules)
# Cleans up formatting rules.
#
- # @param [Hash]
+ # @param [Hash] rules
#
# @return [Hash]
def normalize_formatting_rules(rules)
View
@@ -31,7 +31,7 @@ module ClassMethods
# @example Mismatching currencies
# 'USD 2000'.to_money("EUR") #=> ArgumentError
#
- # @see Money.from_string
+ # @see #from_string
#
def parse(input, currency = nil)
i = input.to_s.strip
@@ -73,7 +73,7 @@ def parse(input, currency = nil)
# according to +currency+ subunit property,
# before instantiating the Money object.
#
- # Behind the scenes, this method relies on {Money.from_bigdecimal}
+ # Behind the scenes, this method relies on {#from_bigdecimal}
# to avoid problems with string-to-numeric conversion.
#
# @param [String, #to_s] value The money amount, in dollars.
@@ -93,7 +93,7 @@ def parse(input, currency = nil)
# #=> #<Money @fractional=100 @currency="BHD">
#
# @see String#to_money
- # @see Money.parse
+ # @see #parse
#
def from_string(value, currency = Money.default_currency)
from_bigdecimal(BigDecimal.new(value.to_s), currency)
@@ -120,7 +120,7 @@ def from_string(value, currency = Money.default_currency)
# #=> #<Money @fractional=100 @currency="BHD">
#
# @see Fixnum#to_money
- # @see Money.from_numeric
+ # @see #from_numeric
#
def from_fixnum(value, currency = Money.default_currency)
currency = Money::Currency.wrap(currency)
@@ -152,7 +152,7 @@ def from_fixnum(value, currency = Money.default_currency)
# #=> #<Money @fractional=100 @currency="BHD">
#
# @see Float#to_money
- # @see Money.from_numeric
+ # @see #from_numeric
#
def from_float(value, currency = Money.default_currency)
from_bigdecimal(BigDecimal.new(value.to_s), currency)
@@ -179,7 +179,7 @@ def from_float(value, currency = Money.default_currency)
# #=> #<Money @fractional=100 @currency="BHD">
#
# @see BigDecimal#to_money
- # @see Money.from_numeric
+ # @see #from_numeric
#
def from_bigdecimal(value, currency = Money.default_currency)
currency = Money::Currency.wrap(currency)
@@ -196,8 +196,8 @@ def from_bigdecimal(value, currency = Money.default_currency)
# and tries to forwards the call to the most appropriate method
# in order to reduce computation effort.
# For instance, if +value+ is an Integer, this method calls
- # {Money.from_fixnum} instead of using the default
- # {Money.from_bigdecimal} which adds the overload to converts
+ # {#from_fixnum} instead of using the default
+ # {#from_bigdecimal} which adds the overload to converts
# the value into a slower BigDecimal instance.
#
# @param [Numeric] value The money amount, in dollars.
@@ -216,9 +216,9 @@ def from_bigdecimal(value, currency = Money.default_currency)
# #=> ArgumentError
#
# @see Numeric#to_money
- # @see Money.from_fixnum
- # @see Money.from_float
- # @see Money.from_bigdecimal
+ # @see #from_fixnum
+ # @see #from_float
+ # @see #from_bigdecimal
#
def from_numeric(value, currency = Money.default_currency)
case value

0 comments on commit b96ef92

Please sign in to comment.