Spec-Zone.ru › Homebrew

Class: CxxStdlib Private

Inherits:
Object
  • Object
  • CxxStdlib
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

  • #compiler ⇒ Symbol readonly private
  • #type ⇒ Symbol? readonly private

Class Method Summary collapse

  • .create(type, compiler) ⇒ CxxStdlib private

Instance Method Summary collapse

  • #initialize(type, compiler) ⇒ void constructor private
  • #type_string ⇒ String private

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:

  • type (Symbol, nil)
  • compiler (Symbol, String)


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

#compiler ⇒ Symbol (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:

  • (Symbol)


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

def compiler
  @compiler
end

#type ⇒ Symbol? (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:

  • (Symbol, nil)


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:

  • type (Symbol, nil)
  • compiler (Symbol, String)

Returns:

  • (CxxStdlib)

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_string ⇒ String

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:

  • (String)


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

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

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/CxxStdlib.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API