Sha256: 1ca0713247b028de33c798639e0357992daff894d2c54be008a4ff8887d939c7

Contents?: true

Size: 825 Bytes

Versions: 2

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

require_relative './../utils/ss_model'

# Root Sourcescrub
module Sourcescrub
  # Apis
  module Apis
    # Companies endpoint
    class Sources
      include ::Sourcescrub::Utils::SsModel

      attr_accessor :args

      def initialize(source_id, args)
        @source_id  = source_id
        @model_type = args.delete(:model_type)
        @args       = args
      end

      def request_url
        [
          Models::Source::ENDPOINT,
          @source_id
        ].compact.join('/')
      end

      def search_url
        [
          'search',
          Models::Source::ENDPOINT
        ].compact.join('/')
      end

      def companies_url
        [
          Models::Source::ENDPOINT,
          @source_id,
          'companies'
        ].compact.join('/')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sourcescrub-0.1.3 lib/sourcescrub/apis/sources.rb
sourcescrub-0.1.2 lib/sourcescrub/apis/sources.rb