Sha256: c9bbe240fc611fe54dfe9b4017f1810bc9d5f487d20fd5fdaa3785c964c19d86

Contents?: true

Size: 1.75 KB

Versions: 5

Compression:

Stored size: 1.75 KB

Contents

module Lelylan
  class Client
    module Type

      #
      # Public: Returns extended information for a given type identified from its ID.
      #
      # id - A String that represent the type ID.
      #
      # Returns Hashie The type.
      #
      def type(id)
        get("/types/#{id}")
      end

      #
      # Public: Returns a list of owned types.
      #
      # params - The Hash used to refine the search (default: {}).
      #
      # Returns Array List of types.
      #
      def types(params = {})
        get('/types', params)
      end

      #
      # Public: Returns a list of all existing types.
      #
      # params - The Hash used to refine the search (default: {}).
      #
      # Returns Array List of types.
      #
      def public_types(params = {})
        get('/types/public', params)
      end

      #
      # Public: Create a type and returns extended information for it.
      #
      # params - The Hash used to create the resource (default: {}).
      #
      # Returns Hashie The created type.
      #
      def create_type(params = {})
        post('/types', params)
      end

      #
      # Public: Update a type identified from its ID and returns extended information for it.
      #
      # id - A String that represent the type ID.
      # params - The Hash used to update the resource (default: {}).
      #
      # Returns Hashie The updated type.
      #
      def update_type(id, params = {})
        put("/types/#{id}", params)
      end

      #
      # Public: Delete a type identified from its ID and returns extended information for it.
      #
      # id - A String that represent the type ID.
      #
      # Returns Hashie The deleted type.
      #
      def delete_type(id)
        delete("/types/#{id}")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lelylan-rb-0.1.0 lib/lelylan/client/type.rb
lelylan-rb-0.0.5 lib/lelylan/client/type.rb
lelylan-rb-0.0.4 lib/lelylan/client/type.rb
lelylan-rb-0.0.3 lib/lelylan/client/type.rb
lelylan-rb-0.0.2 lib/lelylan/client/type.rb