Class: TTY::Link::ANSILink Private
- Inherits:
-
Object
- Object
- TTY::Link::ANSILink
- Defined in:
- lib/tty/link/ansi_link.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Responsible for converting a URL to an ANSI-controlled terminal link
Instance Method Summary collapse
-
#initialize(name, url, attrs) ⇒ ANSILink
constructor
Create an ANSILink instance.
-
#to_s ⇒ String
Convert this link to an ANSI-controlled string.
Constructor Details
#initialize(name, url, attrs) ⇒ ANSILink
Create an TTY::Link::ANSILink instance
63 64 65 66 67 |
# File 'lib/tty/link/ansi_link.rb', line 63 def initialize(name, url, attrs) @name = name @url = url @attrs = attrs end |
Instance Method Details
#to_s ⇒ String
Convert this link to an ANSI-controlled string
78 79 80 81 |
# File 'lib/tty/link/ansi_link.rb', line 78 def to_s attributes = convert_to_attributes(@attrs) [OSC8, SEP, attributes, SEP, @url, BEL, @name, OSC8, SEP, SEP, BEL].join end |