Class: LLVM::Module::TypeCollection
- Inherits:
-
Object
- Object
- LLVM::Module::TypeCollection
- Defined in:
- lib/llvm/core/module.rb
Instance Method Summary collapse
-
#[](key) ⇒ Object
Returns the Type with the a name equal to key (symbol or string).
-
#[]=(key, type) ⇒ Object
Adds the given Type to the collection with a name equal to key (symbol or string).
-
#add(name, type) ⇒ Object
Adds the given Type to the collection with the given name (symbol or string).
-
#initialize(mod) ⇒ TypeCollection
constructor
A new instance of TypeCollection.
-
#named(name) ⇒ Object
Returns the Type with the given name (symbol or string).
Constructor Details
#initialize(mod) ⇒ TypeCollection
Returns a new instance of TypeCollection.
46 47 48 |
# File 'lib/llvm/core/module.rb', line 46 def initialize(mod) @module = mod end |
Instance Method Details
#[](key) ⇒ Object
Returns the Type with the a name equal to key (symbol or string).
61 62 63 |
# File 'lib/llvm/core/module.rb', line 61 def [](key) named(key) end |
#[]=(key, type) ⇒ Object
Adds the given Type to the collection with a name equal to key (symbol or string).
66 67 68 |
# File 'lib/llvm/core/module.rb', line 66 def []=(key, type) add(key, type) end |
#add(name, type) ⇒ Object
Adds the given Type to the collection with the given name (symbol or string).
51 52 53 |
# File 'lib/llvm/core/module.rb', line 51 def add(name, type) C.LLVMAddTypeName(@module, name.to_s, type) end |