Class: Relaton3gpp::Release
- Inherits:
-
Object
- Object
- Relaton3gpp::Release
- Defined in:
- lib/relaton_3gpp/release.rb
Instance Method Summary collapse
-
#initialize(**args) ⇒ Release
constructor
Initialize release.
-
#to_hash ⇒ Hash
Render Hash.
-
#to_xml(builder) ⇒ Object
Render XML.
Constructor Details
#initialize(**args) ⇒ Release
Initialize release.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/relaton_3gpp/release.rb', line 18 def initialize(**args) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength @version2g = args[:version2g] @version3g = args[:version3g] @defunct = args[:defunct] @wpm_code_2g = args[:wpm_code_2g] @wpm_code_3g = args[:wpm_code_3g] @freeze_meeting = args[:freeze_meeting] @freeze_stage1_meeting = args[:freeze_stage1_meeting] @freeze_stage2_meeting = args[:freeze_stage2_meeting] @freeze_stage3_meeting = args[:freeze_stage3_meeting] @close_meeting = args[:close_meeting] @project_start = args[:project_start] @project_end = args[:project_end] end |
Instance Method Details
#to_hash ⇒ Hash
Render Hash.
60 61 62 63 64 65 66 67 68 |
# File 'lib/relaton_3gpp/release.rb', line 60 def to_hash hash = {} instance_variables.each do |var| unless instance_variable_get(var).nil? hash[var.to_s.delete("@")] = instance_variable_get var end end hash end |
#to_xml(builder) ⇒ Object
Render XML.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/relaton_3gpp/release.rb', line 38 def to_xml(builder) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity builder.release do builder.version2G @version2g if @version2g builder.version3G @version3g if @version3g builder.defunct @defunct unless @defunct.nil? builder.send "wpm-code-2G", @wpm_code_2g if @wpm_code_2g builder.send "wpm-code-3G", @wpm_code_3g if @wpm_code_3g builder.send "freeze-meeting", @freeze_meeting if @freeze_meeting builder.send "freeze-stage1-meeting", @freeze_stage1_meeting if @freeze_stage1_meeting builder.send "freeze-stage2-meeting", @freeze_stage2_meeting if @freeze_stage2_meeting builder.send "freeze-stage3-meeting", @freeze_stage3_meeting if @freeze_stage3_meeting builder.send "close-meeting", @close_meeting if @close_meeting builder.send "project-start", @project_start if @project_start builder.send "project-end", @project_end if @project_end end end |