Sha256: 37d5d61b5431733fc31c13c843f6a5d5f0891cde217b067ea87921ed3419df4a

Contents?: true

Size: 685 Bytes

Versions: 16

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

module EgovUtils
  module Iszr
    module Addresses
      class FetchForNaturalPerson
        class FromSampleData < ActiveInteraction::Base
          string :remote_id

          def execute
            attrs = sample_results.detect do |address|
              address['remote_id'] == remote_id
            end

            EgovUtils::Address.new(attrs.except('remote_id'))
          end

          private

          def sample_results
            results = File.read(
              EgovUtils::Engine.root.join('lib/egov_utils/iszr/np_addresses.json')
            )

            JSON.parse(results)
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha16 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha15 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha14 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha13 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha12 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha11 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha10 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha9 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha8 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha7 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha6 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha5 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha4 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha3 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha2 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb
egov_utils-1.5.0.alpha1 app/services/egov_utils/iszr/addresses/fetch_for_natural_person/from_sample_data.rb