module AtCoderFriends::Parser::SampleData

parses sample data and sets to problem

Public Instance Methods

process(pbm) click to toggle source
# File lib/at_coder_friends/parser/sample_data.rb, line 11
def process(pbm)
  pbm.sections.each do |key, section|
    ext =
      if key =~ Problem::SECTION_IN_SMP_PAT
        :in
      elsif key =~ Problem::SECTION_OUT_SMP_PAT
        :exp
      end
    ext && pbm.add_smp(
      $LAST_MATCH_INFO[:no], ext, section.code_block_content
    )
  end
end