Skip to content
This repository
Browse code

Use sanctioned formats interface in example

  • Loading branch information...
commit 623f03adda21fdd3a189289957cdca06084cc7ea 1 parent 82a90c1
Sandro Turriate authored December 07, 2009

Showing 1 changed file with 2 additions and 6 deletions. Show diff stats Hide diff stats

  1. 8  examples/custom_parsers.rb
8  examples/custom_parsers.rb
@@ -3,9 +3,7 @@ class ParseAtom
3 3
 
4 4
   # Support Atom along with the default parsers: xml, json, yaml, etc.
5 5
   class Parser::Atom < HTTParty::Parser
6  
-    def self.formats
7  
-      super.merge({"application/atom+xml" => :atom})
8  
-    end
  6
+    SupportedFormats.merge!({"application/atom+xml" => :atom})
9 7
 
10 8
     protected
11 9
 
@@ -24,9 +22,7 @@ class OnlyParseAtom
24 22
 
25 23
   # Only support Atom
26 24
   class Parser::OnlyAtom < HTTParty::Parser
27  
-    def self.formats
28  
-      {"application/atom+xml" => :atom}
29  
-    end
  25
+    SupportedFormats = {"application/atom+xml" => :atom}
30 26
 
31 27
     protected
32 28
 

0 notes on commit 623f03a

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