Class: RLTK::CG::Triple
- Inherits:
-
Object
- Object
- RLTK::CG::Triple
- Includes:
- BindingClass
- Defined in:
- lib/rltk/cg/triple.rb
Overview
Class binding for the LLVM Triple class.
Instance Attribute Summary
Attributes included from BindingClass
Class Method Summary collapse
-
.host ⇒ Triple
Object representing the host architecture, vendor, OS, and environment.
-
.host_string ⇒ String
String representation of the host architecture, vendor, OS, and environment.
Instance Method Summary collapse
-
#initialize(overloaded) ⇒ Triple
constructor
Create a new triple describing the host architecture, vendor, OS, and (optionally) environment.
-
#to_s ⇒ String
String representation of this triple.
Methods included from BindingClass
Constructor Details
#initialize(overloaded) ⇒ Triple
Create a new triple describing the host architecture, vendor, OS, and (optionally) environment.
45 46 47 48 49 50 51 |
# File 'lib/rltk/cg/triple.rb', line 45 def initialize(overloaded) @ptr, @str = case overloaded when FFI::Pointer then [overloaded, nil] when String then [Bindings.triple_create(overloaded), overloaded] end end |
Class Method Details
.host ⇒ Triple
Returns Object representing the host architecture, vendor, OS, and environment.
28 29 30 |
# File 'lib/rltk/cg/triple.rb', line 28 def self.host @host ||= Triple.new(host_string) end |
.host_string ⇒ String
Returns String representation of the host architecture, vendor, OS, and environment.
33 34 35 |
# File 'lib/rltk/cg/triple.rb', line 33 def self.host_string @host_string ||= Bindings.get_default_target_triple end |
Instance Method Details
#to_s ⇒ String
Returns String representation of this triple.
54 55 56 |
# File 'lib/rltk/cg/triple.rb', line 54 def to_s @str ||= Bindings.get_triple_string(@ptr) end |