Sha256: 12aa0d571dfc097220855313fbfaf044339a4019940337e16fc2c7cbd25f71e0

Contents?: true

Size: 1.22 KB

Versions: 9

Compression:

Stored size: 1.22 KB

Contents

module RedboothRuby
  module ClientOperations
    module Metadata

      # Retrieves all available objects from the Redbooth API by searching by given
      # key and value into the metadata API
      #
      # @param [Hash] options Options to pass to the API
      # @return [Array] The available objects
      def metadata(attributes = {})
        response = RedboothRuby.request(:get, nil, 'metadata/search' , attributes, { session: session })
        collection_from attributes, response, session
      end

      private

      # Creates a collection object from the request and response params
      #
      # @param params [Hash] given request params
      # @param response [RedboothRuby::Request::Response] response object
      # @param session [RedboothRuby::Session] session Object
      # @return [RedboothRuby::Request::Collection]
      def collection_from(params, response, session)
        RedboothRuby::Request::Collection.new(response: response,
                                              resource: self,
                                              session:  session,
                                              params:   params,
                                              method:   :metadata)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
redbooth-ruby-0.2.3 lib/redbooth-ruby/client_operations/metadata.rb
redbooth-ruby-0.2.2 lib/redbooth-ruby/client_operations/metadata.rb
redbooth-ruby-0.2.1 lib/redbooth-ruby/client_operations/metadata.rb
redbooth-ruby-0.2.0 lib/redbooth-ruby/client_operations/metadata.rb
redbooth-ruby-0.1.4 lib/redbooth-ruby/client_operations/metadata.rb
redbooth-ruby-0.1.3 lib/redbooth-ruby/client_operations/metadata.rb
redbooth-ruby-0.1.1 lib/redbooth-ruby/client_operations/metadata.rb
redbooth-ruby-0.1.0 lib/redbooth-ruby/client_operations/metadata.rb
redbooth-ruby-0.0.5 lib/redbooth-ruby/client_operations/metadata.rb