Skip to content

Commit

Permalink
replace calls to #to_s with a var
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshCheek committed Nov 17, 2010
1 parent c61f285 commit 3ee14cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/arsettings/packaged.rb
Expand Up @@ -144,10 +144,11 @@ def remove_boolean_getter(name) # :nodoc:
end

def method_missing(name,*args) # :nodoc:
if name.to_s =~ /\A[A-Z]/
name_to_s = name.to_s
if name_to_s =~ /\A[A-Z]/
settings_class.const_get name , *args
elsif name.to_s !~ /=$/ || ( name.to_s =~ /=$/ && args.size == 1 )
raise ARSettings::NoSuchSettingError.new("There is no setting named #{name.to_s.chomp '='}")
elsif name_to_s !~ /=$/ || ( name_to_s =~ /=$/ && args.size == 1 )
raise ARSettings::NoSuchSettingError.new("There is no setting named #{name_to_s.chomp '='}")
else
super
end
Expand Down

0 comments on commit 3ee14cb

Please sign in to comment.