Class: DaVinciPlanNetTestKit::Generator::IGMetadata
- Inherits:
-
Object
- Object
- DaVinciPlanNetTestKit::Generator::IGMetadata
- Defined in:
- lib/davinci_plan_net_test_kit/generator/ig_metadata.rb
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#ig_version ⇒ Object
Returns the value of attribute ig_version.
Instance Method Summary collapse
- #delayed_groups ⇒ Object
- #delayed_profiles ⇒ Object
- #non_delayed_groups ⇒ Object
- #ordered_groups ⇒ Object
- #postprocess_groups(ig_resources) ⇒ Object
- #reformatted_version ⇒ Object
- #to_hash ⇒ Object
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
6 7 8 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 6 def groups @groups end |
#ig_version ⇒ Object
Returns the value of attribute ig_version.
6 7 8 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 6 def ig_version @ig_version end |
Instance Method Details
#delayed_groups ⇒ Object
23 24 25 26 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 23 def delayed_groups @delayed_groups ||= groups.select { |group| group.delayed? } end |
#delayed_profiles ⇒ Object
33 34 35 36 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 33 def delayed_profiles @delayed_profiles ||= delayed_groups.map(&:profile_url) end |
#non_delayed_groups ⇒ Object
28 29 30 31 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 28 def non_delayed_groups @non_delayed_groups ||= groups.reject { |group| group.delayed? } end |
#ordered_groups ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 12 def ordered_groups if SpecialCases.has_explicit_group_order() @ordered_groups ||= groups.sort_by { |group| SpecialCases.group_index(group.name) } else @ordered_groups ||= non_delayed_groups + delayed_groups end end |
#postprocess_groups(ig_resources) ⇒ Object
38 39 40 41 42 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 38 def postprocess_groups(ig_resources) groups.each do |group| group.add_delayed_references(delayed_profiles, ig_resources) end end |
#reformatted_version ⇒ Object
8 9 10 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 8 def reformatted_version @reformatted_version ||= ig_version.delete('.').gsub('-', '_') end |
#to_hash ⇒ Object
44 45 46 47 48 49 |
# File 'lib/davinci_plan_net_test_kit/generator/ig_metadata.rb', line 44 def to_hash { ig_version: ig_version, groups: groups.map(&:to_hash) } end |