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) ⇒ 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.

Returns a new instance of CxxStdlib.



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

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

Instance Attribute Details

#compilerObject (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.



14
15
16
# File 'cxxstdlib.rb', line 14

def compiler
  @compiler
end

#typeObject (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.



14
15
16
# File 'cxxstdlib.rb', line 14

def type
  @type
end

Class Method Details

.create(type, compiler) ⇒ Object

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.

Raises:

  • (ArgumentError)


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

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_stringObject

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.



21
22
23
# File 'cxxstdlib.rb', line 21

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