Class: TTY::Link::Terminals::Abstract Abstract Private

Inherits:
Object
  • Object
show all
Defined in:
lib/tty/link/terminals/abstract.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.

This class is abstract.

Override #name? and #version? to implement terminal hyperlinks detection

Responsible for providing common terminal detection

Instance Method Summary collapse

Constructor Details

#initialize(semantic_version, env) ⇒ Abstract

Create an TTY::Link::Terminals::Abstract instance

Examples:

terminal = TTY::Link::Terminals::Abstract.new(SemanticVersion, ENV)

Parameters:

  • semantic_version (TTY::Link::SemanticVersion)

    the semantic version creator

  • env (ENV, Hash{String => String})

    the environment variables



64
65
66
67
# File 'lib/tty/link/terminals/abstract.rb', line 64

def initialize(semantic_version, env)
  @semantic_version = semantic_version
  @env = env
end

Instance Method Details

#link?Boolean

Detect a terminal hyperlink support

Examples:

terminal.link?
# => true

Returns:

  • (Boolean)


78
79
80
# File 'lib/tty/link/terminals/abstract.rb', line 78

def link?
  name? && version?
end