Class: UrlExpander::Expanders::Twurlnl
- Defined in:
- lib/url_expander/expanders/basic/twurlnl.rb
Overview
Expand Twurl.nl URLS Usage: UrlExpander::Client.expand(“twurl.nl/e6mglc”)
Defined Under Namespace
Classes: Request
Constant Summary collapse
- PATTERN =
%r'(http://twurl\.nl(/[\w/]+))'
Instance Attribute Summary collapse
-
#parent_klass ⇒ Object
readonly
Returns the value of attribute parent_klass.
Attributes inherited from Basic
Instance Method Summary collapse
-
#fetch_url(path) ⇒ Object
Custom fetcher.
-
#initialize(short_url = "", options = {}) ⇒ Twurlnl
constructor
A new instance of Twurlnl.
Constructor Details
#initialize(short_url = "", options = {}) ⇒ Twurlnl
Returns a new instance of Twurlnl.
14 15 16 17 |
# File 'lib/url_expander/expanders/basic/twurlnl.rb', line 14 def initialize(short_url="",={}) @parent_klass = self super(short_url,) end |
Instance Attribute Details
#parent_klass ⇒ Object (readonly)
Returns the value of attribute parent_klass.
12 13 14 |
# File 'lib/url_expander/expanders/basic/twurlnl.rb', line 12 def parent_klass @parent_klass end |
Instance Method Details
#fetch_url(path) ⇒ Object
Custom fetcher.
20 21 22 23 24 |
# File 'lib/url_expander/expanders/basic/twurlnl.rb', line 20 def fetch_url(path) url = super(path) raise UrlExpander::Error.new('page not found',404) if url == "http://tweetburner.com/pages/blocked" url end |