Parent

FFI::ConstGenerator::Constant

Attributes

name[R]
format[R]
cast[R]
value[RW]

Public Class Methods

new(name, format, cast, ruby_name = nil, converter=nil) click to toggle source
     # File lib/ffi/tools/const_generator.rb, line 150
150:     def initialize(name, format, cast, ruby_name = nil, converter=nil)
151:       @name = name
152:       @format = format
153:       @cast = cast
154:       @ruby_name = ruby_name
155:       @converter = converter
156:       @value = nil
157:     end

Public Instance Methods

converted_value() click to toggle source
     # File lib/ffi/tools/const_generator.rb, line 159
159:     def converted_value
160:       if @converter
161:         @converter.call(@value)
162:       else
163:         @value
164:       end
165:     end
ruby_name() click to toggle source
     # File lib/ffi/tools/const_generator.rb, line 167
167:     def ruby_name
168:       @ruby_name || @name
169:     end
to_ruby() click to toggle source
     # File lib/ffi/tools/const_generator.rb, line 171
171:     def to_ruby
172:       "#{ruby_name} = #{converted_value}"
173:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.