> @@ -24,6 +24,21 @@ def to_a
>      end
>  
>      #
> +    # Returns a cookie by name.
> +    #
> +    # @example
> +    #   browser.cookies[:my_session]
> +    #   #=> {:name=>"my_session", :value=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRkk", 
> :domain=>"mysite.com"}
> +    #
> +    # @param [Symbol] name
> +    # @return <Hash> or nil if not found
> +    #
> +
> +    def [](name)
> +      @control.all_cookies.select { |c| c[:name] == name.to_s }.first

`.select { |c| c[:name] == name.to_s }.first` can be replaced with `.find { |c| 
c[:name] == name.to_s }`

---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-webdriver/pull/249/files#r10554590
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to