Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. 2.2.1 (main):0[1] > Money.new(100, :RUB).currency.symbol
  2. => "₽"
  3. 2.2.1 (main):0[2] > show-method Money.new(100, :RUB).currency.symbol
  4.  
  5. From: /Users/max/.rvm/gems/ruby-2.2.1/gems/money-6.5.1/lib/money/currency.rb @ line 211:
  6. Owner: Money::Currency
  7. Visibility: public
  8. Number of lines: 3
  9.  
  10. attr_reader :id, :priority, :iso_code, :iso_numeric, :name, :symbol,
  11. :disambiguate_symbol, :html_entity, :subunit, :subunit_to_unit, :decimal_mark,
  12. :thousands_separator, :symbol_first, :smallest_denomination
  13. 2.2.1 (main):0[5] > cd Money.new(100, :RUB).currency
  14. 2.2.1 (RUB):1[6] > show-method initialize
  15.  
  16. From: /Users/max/.rvm/gems/ruby-2.2.1/gems/money-6.5.1/lib/money/currency.rb @ line 227:
  17. Owner: Money::Currency
  18. Visibility: private
  19. Number of lines: 8
  20.  
  21. def initialize(id)
  22. # cut...
  23. initialize_data!
  24. end
  25. 2.2.1 (RUB):1[7] > show-method initialize_data!
  26.  
  27. From: /Users/max/.rvm/gems/ruby-2.2.1/gems/money-6.5.1/lib/money/currency.rb @ line 416:
  28. Owner: Money::Currency
  29. Visibility: private
  30. Number of lines: 17
  31.  
  32. def initialize_data!
  33. data = self.class.table[@id]
  34. # cut...
  35. @symbol = data[:symbol]
  36. # cut...
  37. end
  38. 2.2.1 (RUB):1[8] > self.class.table
  39. => {
  40. :aed => {
  41. # cut....
  42. 2.2.1 (RUB):1[9] > self.class.table[:rub]
  43. => {
  44. # cut...
  45. :symbol => "₽",
  46. # cut...
  47. 2.2.1 (RUB):1[11] > self.class.table[:rub][:symbol] = 'rub'
  48. => "rub"
  49. 2.2.1 (RUB):1[12] > Money.new(100, :RUB).currency.symbol
  50. => "rub"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement