Sha256: 25333959142522e99d5e7e2ce2391e6e277c65377822a60cd07cc31c75968fa2

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Azeroth
  class Decorator
    # @api private
    # @author Darthjee
    #
    # Resource buiilding options for decorator
    #
    # @see https://www.rubydoc.info/gems/sinclair/1.6.4/Sinclair/Options
    #   Sinclair::Options
    class Options < Sinclair::Options
      DEFAULT_OPTIONS = {
        as: nil,
        if: nil
      }.freeze

      with_options DEFAULT_OPTIONS

      # @method as
      # @api private
      # @public
      #
      # key to use when exposing the field
      #
      # when nil, the name of the field
      #
      # @return [Symbol,String]

      # @method if
      # @api private
      # @public
      #
      # conditional to be checked when exposing field
      #
      # when conditional returns false, the
      # field will not be exposed
      #
      # when if is a {Proc} the proc will be used,
      # when it is a {Symbol} or {String} this will be
      # the name of the method called in the decorator
      # to evaluate the condition
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
azeroth-0.6.2 lib/azeroth/decorator/options.rb