File: url_entity.rb

package info (click to toggle)
mikutter 5.0.4%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,700 kB
  • sloc: ruby: 21,307; sh: 181; makefile: 19
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