Module: TweetUrl::Status
- Included in:
- Base
- Defined in:
- lib/tweet_url/status.rb
Class Method Summary collapse
-
.status_id(object, parser = DEFAULT_PARSER) ⇒ Integer, NilClass
Take a URI string or URI object and return its ID.
Instance Method Summary collapse
Class Method Details
.status_id(object, parser = DEFAULT_PARSER) ⇒ Integer, NilClass
Take a URI string or URI object and return its ID
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/tweet_url/status.rb', line 12 def self.status_id(object, parser = DEFAULT_PARSER) case object when ::Integer object when ::String Status::status_id(parser.parse(object), parser) when parser Status::status_id(Uri.hashbang_path_or_path(object).split('/')) when Enumerable Uri::find_resource_id(object) {|s| /\Astatus(?:es)?\z/ === s} else nil end end |