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.
245 246 247 248 |
# File 'lib/rbind/generator_c.rb', line 245 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
250 251 252 253 254 |
# File 'lib/rbind/generator_c.rb', line 250 def operation_wrapper(op) raise unless op op2 = OperationHelper.new(op) @operation_wrapper.result(op2.binding) end |
#wrap_operations ⇒ Object
256 257 258 259 260 261 262 263 264 |
# File 'lib/rbind/generator_c.rb', line 256 def wrap_operations str = "" @root.each_container do |type| type.each_operation do |op| str += operation_wrapper(op) end end str end |