Class: Rbind::GeneratorC::OperationsHelper
- Inherits:
-
HelperBase
- Object
- HelperBase
- Rbind::GeneratorC::OperationsHelper
- Defined in:
- lib/rbind/generator_c.rb
Defined Under Namespace
Classes: OperationHelper
Instance Attribute Summary
Attributes inherited from HelperBase
Instance Method Summary collapse
-
#initialize(name, root) ⇒ OperationsHelper
constructor
A new instance of OperationsHelper.
- #operation_wrapper(op) ⇒ Object
- #wrap_operations ⇒ Object
Methods inherited from HelperBase
Constructor Details
#initialize(name, root) ⇒ OperationsHelper
Returns a new instance of OperationsHelper.
238 239 240 241 |
# File 'lib/rbind/generator_c.rb', line 238 def initialize(name,root) super @operation_wrapper = ERB.new(File.open(File.join(File.dirname(__FILE__),"templates","c","operation_wrapper.cc")).read,nil,"-") end |
Instance Method Details
#operation_wrapper(op) ⇒ Object
243 244 245 246 247 |
# File 'lib/rbind/generator_c.rb', line 243 def operation_wrapper(op) raise unless op op2 = OperationHelper.new(op) @operation_wrapper.result(op2.binding) end |
#wrap_operations ⇒ Object
249 250 251 252 253 254 255 256 257 |
# File 'lib/rbind/generator_c.rb', line 249 def wrap_operations str = "" @root.each_container do |type| type.each_operation do |op| str += operation_wrapper(op) end end str end |