Class: Rbind::GeneratorC::HelperBase

Inherits:
Object
  • Object
show all
Defined in:
lib/rbind/generator_c.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, root, extern_types = Hash.new) ⇒ 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_typesObject

Returns the value of attribute extern_types.



10
11
12
# File 'lib/rbind/generator_c.rb', line 10

def extern_types
  @extern_types
end

#includesObject

Returns the value of attribute includes.



8
9
10
# File 'lib/rbind/generator_c.rb', line 8

def includes
  @includes
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/rbind/generator_c.rb', line 9

def name
  @name
end

Instance Method Details

#bindingObject



29
30
31
# File 'lib/rbind/generator_c.rb', line 29

def binding
    Kernel.binding
end

#wrap_includesObject



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