lib/abide_dev_utils/xccdf/parser/objects.rb
def method_missing(method_name, *args, &block)
            m_name_string = method_name.to_s.downcase
            return @label_method_values[m_name_string] if @label_method_values.key?(m_name_string)

            label_str = m_name_string.start_with?('linked_') ? m_name_string.split('_')[1..].join('_') : m_name_string
            if m_name_string.start_with?('linked_') && @link_labels.include?(label_str)
              found = @links.select { |link| link.label == label_str }
              @label_method_values["linked_#{label_str}"] = if found.length == 1
                                                              found.first
                                                            else
                                                              found
                                                            end
              @label_method_values["linked_#{label_str}"]
            elsif @child_labels.include?(label_str)
              found = @children.select { |child| child.label == label_str }
              @label_method_values[label_str] = if found.length == 1
                                                  found.first
                                                else
                                                  found
                                                end
              @label_method_values[label_str]
            else
              super
            end
          end
# Allows access to child objects by label
Allows access to child objects by label
Allows access to child objects by label
def method_missing(method_name, *args, &block)
            m_name_string = method_name.to_s.downcase
            return @label_method_values[m_name_string] if @label_method_values.key?(m_name_string)
            label_str = m_name_string.start_with?('linked_') ? m_name_string.split('_')[1..].join('_') : m_name_string
            if m_name_string.start_with?('linked_') && @link_labels.include?(label_str)
              found = @links.select { |link| link.label == label_str }
              @label_method_values["linked_#{label_str}"] = if found.length == 1
                                                              found.first
                                                            else
                                                              found
                                                            end
              @label_method_values["linked_#{label_str}"]
            elsif @child_labels.include?(label_str)
              found = @children.select { |child| child.label == label_str }
              @label_method_values[label_str] = if found.length == 1
                                                  found.first
                                                else
                                                  found
                                                end
              @label_method_values[label_str]
            else
              super
            end
          end
def method_missing ( method_name , * args , & block ) m_name_string = method_name . to_s . downcase return @label_method_values [ m_name_string ] if @label_method_values . key? ( m_name_string ) label_str = m_name_string . start_with? ( 'linked_' ) ? m_name_string . split ( '_' ) [ 1 .. ] . join ( '_' ) : m_name_string if m_name_string . start_with? ( 'linked_' ) && @link_labels . include? ( label_str ) found = @links . select { | link | link . label == label_str } @label_method_values [ "linked_#{label_str}" ] = if found . length == 1 found . first else found end @label_method_values [ "linked_#{label_str}" ] elsif @child_labels . include? ( label_str ) found = @children . select { | child | child . label == label_str } @label_method_values [ label_str ] = if found . length == 1 found . first else found end @label_method_values [ label_str ] else super end end
Allows access to child objects by label
Allows access to child objects by label
method_name
args
block