Sha256: 6044307f8ae7666ac177fd8ba118b3b5be757c710d20ecce40090b74589b6634

Contents?: true

Size: 571 Bytes

Versions: 9

Compression:

Stored size: 571 Bytes

Contents

# frozen_string_literal: true

module NovaposhtaApi
  module Models
    class Counterparty < Model
      property :ref, from: :Ref
      property :first_name, from: :FirstName
      property :middle_name, from: :MiddleName
      property :last_name, from: :LastName
      property :phone, from: :Phone
      property :description, from: :Description
      property :city, from: :City
      property :persons, from: :ContactPerson

      def person
        @person ||= NovaposhtaApi::Models::Counterparty.extract_single(persons['data']&.first)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
novaposhta_api-0.1.9 lib/novaposhta_api/models/counterparty.rb
novaposhta_api-0.1.8 lib/novaposhta_api/models/counterparty.rb
novaposhta_api-0.1.7 lib/novaposhta_api/models/counterparty.rb
novaposhta_api-0.1.5 lib/novaposhta_api/models/counterparty.rb
novaposhta_api-0.1.4 lib/novaposhta_api/models/counterparty.rb
novaposhta_api-0.1.3 lib/novaposhta_api/models/counterparty.rb
novaposhta_api-0.1.2 lib/novaposhta_api/models/counterparty.rb
novaposhta_api-0.1.1 lib/novaposhta_api/models/counterparty.rb
novaposhta_api-0.1.0 lib/novaposhta_api/models/counterparty.rb