Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use keyword arguments instead of options hash #37

Merged
merged 2 commits into from Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions humanize.gemspec
Expand Up @@ -5,6 +5,7 @@ Gem::Specification.new do |s|
s.name = "humanize"
s.version = "1.7.0"

s.required_ruby_version = '>= 2.0'
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Jack Chen", "Ryan Bigg"]
Expand Down
6 changes: 3 additions & 3 deletions lib/humanize.rb
Expand Up @@ -8,9 +8,9 @@ module Humanize
# Big numbers are big: http://wiki.answers.com/Q/What_number_is_after_vigintillion&src=ansTT


def humanize(options = {})
locale = options[:locale] || Humanize.config.default_locale
decimals_as = options[:decimals_as] || Humanize.config.decimals_as
def humanize(locale: Humanize.config.default_locale,
decimals_as: Humanize.config.decimals_as)

number_grouping = WORDS[locale][:group_by]
num = self
o = ''
Expand Down