File: url_entity.rb

package info (click to toggle)
mikutter 3.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,256 kB
  • ctags: 2,165
  • sloc: ruby: 19,079; sh: 205; makefile: 20
file content (16 lines) | stat: -rw-r--r-- 413 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*- coding: utf-8 -*-

require_relative 'regexp_entity'

module Retriever::Entity

=begin rdoc
schemeはhttpまたはhttpsのURLを全てリンクにするEntity。
==== Examples

   Retriever::Entity::URLEntity.new(message)

=end
  URLEntity = Retriever::Entity::RegexpEntity.filter(URI.regexp(%w<http https>),
                                                     generator: ->s{ s.merge(open: s[:url]) })
end