Sha256: 56d0bdd8759c34c96595fe862f504c26e6095e0c192177433783c635d4a3287e

Contents?: true

Size: 535 Bytes

Versions: 16

Compression:

Stored size: 535 Bytes

Contents

require "goon_model_gen"

require "goon_model_gen/source/type"
require "goon_model_gen/source/field"

module GoonModelGen
  module Source
    class Struct < Type
      attr_accessor :id_name, :id_type
      attr_accessor :ref_name

      def fields
        @fields ||= []
      end

      # @param name [string]
      # @param attrs [Hash<String,Object>]
      def new_field(name, attrs)
        Field.new(name, attrs).tap do |f|
          f.context = self.context
          self.fields.push(f)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
goon_model_gen-0.4.3 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.4.2 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.4.1 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.4.0 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.3.1 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.3.0 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.2.5 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.2.4 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.2.3 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.2.2 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.2.1 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.2.0 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.1.3 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.1.2 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.1.1 lib/goon_model_gen/source/struct.rb
goon_model_gen-0.1.0 lib/goon_model_gen/source/struct.rb