Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/e9_crm/rails_extensions.rb

Direct Known Subclasses

E9Crm::LabeledString

Instance Method Summary collapse

Instance Method Details

#centsObject



45
46
47
# File 'lib/e9_crm/rails_extensions.rb', line 45

def cents
  self
end

#to_money(currency = nil) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/e9_crm/rails_extensions.rb', line 37

def to_money(currency = nil)
  if match /^$|[^\$\d\.\,]/
    self
  else
    Money.parse(self, currency)
  end
end