Sha256: bf26b6f0f96cc10f6c4a752e255535361fe5f1ed37127b4d5156c98ba7ef0841

Contents?: true

Size: 713 Bytes

Versions: 5

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

module Azeroth
  module Resourceable
    # @api public
    # @author Darthjee
    #
    # Class methods added by {Resourceable}
    module ClassMethods
      # Adds resource methods for resource
      #
      # @param name [String, Symbol] Name of the resource
      # @param options [Hash]
      #
      # @return [Array<MethodDefinition>]
      #
      # @example
      #   class DocumentsController < ApplicationController
      #     include Azeroth::Resourceable
      #
      #     resource_for :document
      #   end
      def resource_for(name, **options)
        Builder.new(
          self, name, Azeroth::Options.new(options)
        ).build
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
azeroth-0.4.0 lib/azeroth/resourceable/class_methods.rb
azeroth-0.3.0 lib/azeroth/resourceable/class_methods.rb
azeroth-0.2.0 lib/azeroth/resourceable/class_methods.rb
azeroth-0.1.0 lib/azeroth/resourceable/class_methods.rb
azeroth-0.0.7 lib/azeroth/resourceable/class_methods.rb