Class: CxxStdlib Private

Inherits:
Object show all
Defined in:
cxxstdlib.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Combination of C++ standard library and compiler.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, compiler) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:



22
23
24
25
# File 'cxxstdlib.rb', line 22

def initialize(type, compiler)
  @type = type
  @compiler = T.let(compiler.to_sym, Symbol)
end

Instance Attribute Details

#compilerSymbol (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



19
20
21
# File 'cxxstdlib.rb', line 19

def compiler
  @compiler
end

#typeSymbol? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



16
17
18
# File 'cxxstdlib.rb', line 16

def type
  @type
end

Class Method Details

.create(type, compiler) ⇒ CxxStdlib

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

Raises:

  • (ArgumentError)


9
10
11
12
13
# File 'cxxstdlib.rb', line 9

def self.create(type, compiler)
  raise ArgumentError, "Invalid C++ stdlib type: #{type}" if type && [:libstdcxx, :libcxx].exclude?(type)

  CxxStdlib.new(type, compiler)
end

Instance Method Details

#type_stringString

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



28
29
30
# File 'cxxstdlib.rb', line 28

def type_string
  type.to_s.gsub(/cxx$/, "c++")
end