Class: Eddy::Build::Loop::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/eddy/build/loop/base.rb

Overview

Generate Ruby code from JSON/YAML EDI definitions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(summary, t_set_id) ⇒ void

Parameters:



18
19
20
21
# File 'lib/eddy/build/loop/base.rb', line 18

def initialize(summary, t_set_id)
  self.summary  = summary
  self.t_set_id = t_set_id
end

Instance Attribute Details

#summaryEddy::Summary::Loop

Returns:



10
11
12
# File 'lib/eddy/build/loop/base.rb', line 10

def summary
  @summary
end

#t_set_idString

Namespace the Loop is within.

Returns:

  • (String)


13
14
15
# File 'lib/eddy/build/loop/base.rb', line 13

def t_set_id
  @t_set_id
end

Instance Method Details

#ginny_classGinny::Class

Returns:

  • (Ginny::Class)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/eddy/build/loop/base.rb', line 29

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

#renderString

Returns:

  • (String)


24
25
26
# File 'lib/eddy/build/loop/base.rb', line 24

def render()
  return self.ginny_class.render()
end