Sha256: 4752f39e7c779b247af2a2317e887bb97fc8df6a12527a38c4df9acc59f381ce

Contents?: true

Size: 1.21 KB

Versions: 11

Compression:

Stored size: 1.21 KB

Contents

require "ginny"

module Eddy
  module Build
    module Loop
      # Generate Ruby code from JSON/YAML EDI definitions.
      class Base

        # @return [Eddy::Summary::Loop]
        attr_accessor :summary
        # Namespace the Loop is within.
        # @return [String]
        attr_accessor :t_set_id

        # @param summary [Eddy::Summary::Loop]
        # @param t_set_id [String]
        # @return [void]
        def initialize(summary, t_set_id)
          self.summary  = summary
          self.t_set_id = t_set_id
        end

        # @return [String]
        def render()
          return self.ginny_class.render()
        end

        # @return [Ginny::Class]
        def ginny_class()
          return Ginny::Class.create({
            classify_name: false,
            parent: "Eddy::Models::Loop::Base",
            name: "Base",
            description: summary.doc_comment(header: true),
            body: <<~STR.strip,
              # @param store [Eddy::Data::Store]
              # @return [void]
              def initialize(store)
                @repeat_limit = #{self.summary.repeat_limit}
                super(store, Repeat)
              end
            STR
          })
        end

      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
eddy-0.10.0 lib/eddy/build/loop/base.rb
eddy-0.9.2 lib/eddy/build/loop/base.rb
eddy-0.9.1 lib/eddy/build/loop/base.rb
eddy-0.9.0 lib/eddy/build/loop/base.rb
eddy-0.8.4 lib/eddy/build/loop/base.rb
eddy-0.8.3 lib/eddy/build/loop/base.rb
eddy-0.8.2 lib/eddy/build/loop/base.rb
eddy-0.8.1 lib/eddy/build/loop/base.rb
eddy-0.8.0 lib/eddy/build/loop/base.rb
eddy-0.7.0 lib/eddy/build/loop/base.rb
eddy-0.6.0 lib/eddy/build/loop/base.rb