File: url_entity.rb

package info (click to toggle)
mikutter 5.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,780 kB
  • sloc: ruby: 22,912; sh: 186; makefile: 21
file content (16 lines) | stat: -rw-r--r-- 393 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*- coding: utf-8 -*-

require_relative 'regexp_entity'

module Diva::Entity

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

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

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