Sha256: 2ea739fa0a42c538112f1ab9a1cd60a7da1ada6bea6cb7852ac02671320ece83

Contents?: true

Size: 599 Bytes

Versions: 2

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true

module VirusTotal
  module Client
    module Action
      module Relationships
        def relationships
          []
        end

        def method_missing(method, *args)
          if relationships.include?(method)
            id = to_id(args.first)
            params = args.length == 2 ? args[1] : {}

            _get("/#{name}/#{id}/#{method}", params) { |json| json }
          else
            super
          end
        end

        def respond_to_missing?(method_name, *)
          relationships.include? method_name
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
virustotalx-1.2.0 lib/virustotal/clients/actions/relationships.rb
virustotalx-1.1.0 lib/virustotal/clients/actions/relationships.rb