Sha256: 672975e81bdd53995f1a909d8a1db9634b9f4f576b7b3ba97d4c74cf0729f093

Contents?: true

Size: 253 Bytes

Versions: 28

Compression:

Stored size: 253 Bytes

Contents

# frozen_string_literal: true

NilClass.class_eval do
  # :nodoc:
  def usd_to_f
    nil
  end
end

Numeric.class_eval do
  # :nodoc:
  def usd_to_f
    to_f
  end
end

String.class_eval do
  # :nodoc:
  def usd_to_f
    gsub(/[$,]/, '').to_f
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
ruby-rails-extensions-2.1.2 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.2.pre.pre.pre.1 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.1 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.14 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.13 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.12 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.11 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.10 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.9 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.8 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.7 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.6 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.5 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.4 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.3 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.2 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.1.0.pre.rc.1 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.0.1 lib/ruby-rails-extensions/extensions/usd_to_f.rb
ruby-rails-extensions-2.0.1.pre.rc.1 lib/ruby-rails-extensions/extensions/usd_to_f.rb