Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return objects instead of strings #40

Closed
twingly-mob opened this issue Oct 12, 2015 · 0 comments
Closed

Return objects instead of strings #40

twingly-mob opened this issue Oct 12, 2015 · 0 comments

Comments

@twingly-mob
Copy link
Member

Ideas:

Twingly::URL::Normalize.normalize(potential_urls)
# => [Twingly::URLObject]
url = Twingly::URL.new(potential_url)
url.valid?
url.without_host.to_s
url.without_path.to_s
url.normalized.to_s

Twingly::URL.extract_urls(text).each do |url|
  puts url.without_host.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant