internetee/registry

View on GitHub
lib/serializers/registrant_api/company.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module Serializers
  module RegistrantApi
    class Company
      attr_reader :company, :country_code

      def initialize(company:, country_code:)
        @company = company
        @country_code = country_code
      end

      def to_json(*_args)
        {
          name: company.company_name,
          registry_no: company.registration_number,
          country_code: @country_code,
        }
      end
    end
  end
end