Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

make an explicit key set so they're all normalized as symbols

  • Loading branch information...
commit c0b7fd3496249da75eae11557e1d697d754ed84f 1 parent 6243f16
risk danger olson authored November 09, 2013

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  lib/faraday/options.rb
6  lib/faraday/options.rb
@@ -48,7 +48,7 @@ def merge(value)
48 48
 
49 49
     # Public
50 50
     def fetch(key, *args)
51  
-      return send(key) if keys.include?(key)
  51
+      return send(key) if symbolized_key_set.include?(key.to_sym)
52 52
 
53 53
       key_setter = "#{key}="
54 54
 
@@ -130,6 +130,10 @@ def [](key)
130 130
       end
131 131
     end
132 132
 
  133
+    def symbolized_key_set
  134
+      @symbolized_key_set ||= Set.new(keys.map { |k| k.to_sym })
  135
+    end
  136
+
133 137
     def self.inherited(subclass)
134 138
       super
135 139
       subclass.attribute_options.update(attribute_options)

0 notes on commit c0b7fd3

Please sign in to comment.
Something went wrong with that request. Please try again.