Sha256: 16a058641c2db923a3bd571af8ed5309f2dcbe29a0fa9f19006bc93adacc68c0

Contents?: true

Size: 591 Bytes

Versions: 13

Compression:

Stored size: 591 Bytes

Contents

# frozen_string_literal: true

require "gir_ffi/builders/base_type_builder"
module GirFFI
  module Builders
    # Implements the creation of a constant. Though semantically not a
    # type, its build method is like that of the types, in that it is
    # triggered by a missing constant in the parent namespace.  The
    # constant will be attached to the appropriate namespace module.
    class ConstantBuilder < BaseTypeBuilder
      def build_class
        @klass ||= optionally_define_constant namespace_module, @classname do
          info.value
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gir_ffi-0.17.0 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.16.1 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.16.0 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.9 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.8 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.7 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.6 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.5 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.4 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.3 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.2 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.1 lib/gir_ffi/builders/constant_builder.rb
gir_ffi-0.15.0 lib/gir_ffi/builders/constant_builder.rb