Permalink
Browse files

Moving errors to OEmbed & lib/oembed/errors.rb

  • Loading branch information...
1 parent 205b123 commit f057f62746aec42a705bd3b46b95e0de4d098ff0 @judofyr judofyr committed May 11, 2008
Showing with 7 additions and 5 deletions.
  1. +1 −0 lib/oembed.rb
  2. +4 −0 lib/oembed/errors.rb
  3. +0 −3 lib/oembed/provider.rb
  4. +2 −2 lib/oembed/providers.rb
View
@@ -8,6 +8,7 @@
require 'net/http'
+require 'oembed/errors'
require 'oembed/provider'
require 'oembed/providers'
require 'oembed/response'
View
@@ -0,0 +1,4 @@
+module OEmbed
+ NotFound = Class.new(StandardError)
+ UnkownFormat = Class.new(StandardError)
+end
View
@@ -1,8 +1,5 @@
module OEmbed
class Provider
- class NotFound<StandardError;end
- class UnknownFormat<StandardError;end
-
attr_accessor :format, :name, :url, :urls, :endpoint
def initialize(endpoint, format = :json)
View
@@ -28,12 +28,12 @@ def find(url)
end
def raw(url, options = {})
- provider = find(url) || raise(OEmbed::Provider::NotFound)
+ provider = find(url) || raise(OEmbed::NotFound)
provider.raw(url, options)
end
def get(url, options = {})
- provider = find(url) || raise(OEmbed::Provider::NotFound)
+ provider = find(url) || raise(OEmbed::NotFound)
provider.get(url, options)
end
end

0 comments on commit f057f62

Please sign in to comment.