Sha256: 7d28c36b940980d4392b5b98ae2558812c08d50fda81d63284076d4e3c42b9cd

Contents?: true

Size: 681 Bytes

Versions: 1

Compression:

Stored size: 681 Bytes

Contents

module Mavenlink
  class Response < BrainstemAdaptor::Response

    attr_reader :client

    # @param response_data [String, Hash]
    # @param specification [BrainstemAdaptor::Specification]
    # @param client [Mavenlink::Client]
    def initialize(response_data, client = Mavenlink.client, specification = Mavenlink.specification)
      @client = client
      super(response_data, specification)
    end

    # Returns collection records
    # Wraps brainstem records into mavenlink models
    # @override
    # @return [Array<MavenLink::Model>]
    def results
      super.map { |record| Mavenlink::Model.models[record.collection_name].wrap(record, client) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mavenlink-0.0.1 lib/mavenlink/response.rb