Sha256: 130a416c5a179890df4bdcbd1bd11ae8ed3cd2acb618b2ea9c9bafba7436da13

Contents?: true

Size: 626 Bytes

Versions: 5

Compression:

Stored size: 626 Bytes

Contents

module EgovUtils
  module Iszr
    module LegalPeople
      class Search < ActiveInteraction::Base
        string :ico

        validates :ico, presence: true

        def execute
          person = find_person_service.run(ico:)
          if person.valid?
            person.result
          else
            errors.merge!(person.errors)
          end
        end

        private

        def find_person_service
          if Rails.env.production?
            EgovUtils::Iszr::LegalPeople::CreateRequest
          else
            EgovUtils::Iszr::LegalPeople::DevSearch
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha15 app/services/egov_utils/iszr/legal_people/search.rb
egov_utils-1.5.0.alpha14 app/services/egov_utils/iszr/legal_people/search.rb
egov_utils-1.5.0.alpha13 app/services/egov_utils/iszr/legal_people/search.rb
egov_utils-1.5.0.alpha12 app/services/egov_utils/iszr/legal_people/search.rb
egov_utils-1.5.0.alpha11 app/services/egov_utils/iszr/legal_people/search.rb