Class: Rbind::GeneratorC::HelperBase
- Inherits:
-
Object
- Object
- Rbind::GeneratorC::HelperBase
- Defined in:
- lib/rbind/generator_c.rb
Direct Known Subclasses
CMakeListsHelper, ConstsHelper, ConversionsHelper, ConversionsHelperHDR, OperationsHDRHelper, OperationsHelper, TypesHelper, TypesHelperHDR
Instance Attribute Summary collapse
-
#extern_types ⇒ Object
Returns the value of attribute extern_types.
-
#includes ⇒ Object
Returns the value of attribute includes.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #binding ⇒ Object
-
#initialize(name, root, extern_types = Hash.new) ⇒ HelperBase
constructor
A new instance of HelperBase.
- #wrap_includes ⇒ Object
Constructor Details
#initialize(name, root, extern_types = Hash.new) ⇒ HelperBase
Returns a new instance of HelperBase.
12 13 14 15 16 17 |
# File 'lib/rbind/generator_c.rb', line 12 def initialize(name,root,extern_types=Hash.new) @root = root @name = name @includes = [] @extern_types = extern_types end |
Instance Attribute Details
#extern_types ⇒ Object
Returns the value of attribute extern_types.
10 11 12 |
# File 'lib/rbind/generator_c.rb', line 10 def extern_types @extern_types end |
#includes ⇒ Object
Returns the value of attribute includes.
8 9 10 |
# File 'lib/rbind/generator_c.rb', line 8 def includes @includes end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/rbind/generator_c.rb', line 9 def name @name end |
Instance Method Details
#binding ⇒ Object
29 30 31 |
# File 'lib/rbind/generator_c.rb', line 29 def binding Kernel.binding end |
#wrap_includes ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/rbind/generator_c.rb', line 19 def wrap_includes includes.map do |i| if i =~ /<.*>/ "#include #{i}" else "#include \"#{i}\"" end end.join("\n") end |