Sha256: a6dd02a13283ae8239b01db18a44ce76156b1881a47437e1d58897ed4b69c5cd

Contents?: true

Size: 803 Bytes

Versions: 10

Compression:

Stored size: 803 Bytes

Contents

require "goon_model_gen"

require "goon_model_gen/builder/abstract_builder"

require "goon_model_gen/golang/packages"
require "goon_model_gen/golang/datastore_supported"


module GoonModelGen
  module Builder
    class ValidationBuilder < AbstractBuilder

      # @return [Golang::Packages]
      def build(*)
        Golang::Packages.new.tap do |r|
          r.new_package(base_package_path).tap do |pkg|
            t = pkg.new_struct('ValidationError')
            pkg.new_file('validation_error.go').tap do |f|
              build_sentences_with('validation/error', t, nil)
            end
          end
        end
      end

      # @param pkgs [Golang::Packages]
      def resolve_type_names(pkgs)
        pkgs.resolve_type_names(Golang::DatastoreSupported.packages)
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
goon_model_gen-0.3.1 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.3.0 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.2.5 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.2.4 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.2.3 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.2.2 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.2.1 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.2.0 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.1.3 lib/goon_model_gen/builder/validation_builder.rb
goon_model_gen-0.1.2 lib/goon_model_gen/builder/validation_builder.rb