Sha256: bb7dc907e31a2a145df5c06609ca55aba435954d9f9b554cb4e0426ad7582c5c

Contents?: true

Size: 1.57 KB

Versions: 3

Compression:

Stored size: 1.57 KB

Contents

module FBO::Parser::PresolicitationHandler
  TAGS = %w( PRESOL DATE YEAR CBAC PASSWORD ZIP CLASSCOD NAICS OFFADD ) +
    %w( AGENCY OFFICE LOCATION SUBJECT SOLNBR RESPDATE ARCHDATE CONTACT DESC ) +
    %w( LINK URL EMAIL ADDRESS SETASIDE POPADDRESS POPZIP POPCOUNTRY \/PRESOL )

  ANY_PRESOL_TAG           = TAGS.join("|")
  PRESOLICITATION_PATTERN  = /^<PRESOL>/


  def is_presolicitation?(text)
    text =~ PRESOLICITATION_PATTERN
  end

  def parse(text)
    params = {
      date: date(text),
      year: year(text),
      zip:  zip(text),
      class_code: classification_code(text),
      naics_code: naics_code(text),
      agency: agency(text),
      office: office(text),
      location: location(text),
      office_address: office_address(text),
      subject: subject(text),
      solicitation_number: solicitation_number(text),
      response_date: response_date(text),
      archive_date: archive_date(text),
      contact_info: contact(text),
      description: description(text),
      link_url: link_url(text),
      link_description: link_description(text),
      email_address: email_address(text),
      email_description: email_description(text),
      setaside: set_aside(text),
      pop_address: pop_address(text),
      pop_zip: pop_zip_code(text),
      pop_country: pop_country(text)
    }
    FBO::Notices::Presolicitation.new(params)
  end


  protected

  # Returns a concatenated list of all tags for the notice
  #
  # @return [String]
  def any_notice_tag
    ANY_PRESOL_TAG
  end


  extend FBO::Parser::NoticeHandler
  extend FBO::Parser::ParserHelper
  extend self
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fbo-0.0.3 lib/fbo/parser/presolicitation_handler.rb
fbo-0.0.2 lib/fbo/parser/presolicitation_handler.rb
fbo-0.0.1 lib/fbo/parser/presolicitation_handler.rb