sorbet/rbi/gems/draper@4.0.2.rbi
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `draper` gem.
# Please instead update this file by running `bin/tapioca gem draper`.
# source://draper//lib/draper/railtie.rb#3
module ActiveModel
class << self
# source://activemodel/7.0.5/lib/active_model.rb#72
def eager_load!; end
# source://activemodel/7.0.5/lib/active_model/gem_version.rb#5
def gem_version; end
# source://activemodel/7.0.5/lib/active_model/version.rb#7
def version; end
end
end
# source://draper//lib/draper/railtie.rb#4
class ActiveModel::Railtie < ::Rails::Railtie; end
# source://draper//lib/draper/version.rb#1
module Draper
extend ::Draper::Configuration
class << self
# source://draper//lib/draper.rb#37
def setup_action_controller(base); end
# source://draper//lib/draper.rb#48
def setup_action_mailer(base); end
# source://draper//lib/draper.rb#54
def setup_orm(base); end
# source://draper//lib/draper/undecorate.rb#2
def undecorate(object); end
# source://draper//lib/draper/undecorate.rb#10
def undecorate_chain(object); end
end
end
# source://draper//lib/draper/automatic_delegation.rb#2
module Draper::AutomaticDelegation
extend ::ActiveSupport::Concern
mixes_in_class_methods ::Draper::AutomaticDelegation::ClassMethods
# @private
# @return [Boolean]
#
# source://draper//lib/draper/automatic_delegation.rb#22
def delegatable?(method); end
# source://draper//lib/draper/automatic_delegation.rb#9
def method_missing(method, *args, **_arg2, &block); end
private
# Checks if the decorator responds to an instance method, or is able to
# proxy it to the source object.
#
# @return [Boolean]
#
# source://draper//lib/draper/automatic_delegation.rb#17
def respond_to_missing?(method, include_private = T.unsafe(nil)); end
end
# source://draper//lib/draper/automatic_delegation.rb#28
module Draper::AutomaticDelegation::ClassMethods
# Avoids reloading the model class when ActiveSupport clears autoloaded
# dependencies in development mode.
#
# @private
#
# source://draper//lib/draper/automatic_delegation.rb#50
def before_remove_const; end
# @private
# @return [Boolean]
#
# source://draper//lib/draper/automatic_delegation.rb#43
def delegatable?(method); end
# source://draper//lib/draper/automatic_delegation.rb#30
def method_missing(method, *args, **_arg2, &block); end
private
# Checks if the decorator responds to a class method, or is able to proxy
# it to the source class.
#
# @return [Boolean]
#
# source://draper//lib/draper/automatic_delegation.rb#38
def respond_to_missing?(method, include_private = T.unsafe(nil)); end
end
# source://draper//lib/draper/collection_decorator.rb#2
class Draper::CollectionDecorator
include ::Enumerable
include ::Draper::ViewHelpers
include ::Draper::QueryMethods
extend ::Draper::ViewHelpers::ClassMethods
extend ::Draper::Delegation
# @option options
# @option options
# @param object [Enumerable] collection to decorate.
# @param options [Hash] a customizable set of options
# @return [CollectionDecorator] a new instance of CollectionDecorator
#
# source://draper//lib/draper/collection_decorator.rb#30
def initialize(object, options = T.unsafe(nil)); end
# source://draper//lib/draper/delegation.rb#10
def &(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def *(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def +(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def -(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def <<(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def ==(arg); end
# source://draper//lib/draper/delegation.rb#10
def [](*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def []=(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def all?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def any?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def append(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def as_json(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def assoc(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def at(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def bsearch(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def bsearch_index(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def chain(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def chunk(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def chunk_while(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def clear(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def collect(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def collect!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def collect_concat(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def combination(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def compact(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def compact!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def compact_blank(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def compact_blank!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def concat(*_arg0, **_arg1, &_arg2); end
# @return [Hash] extra data to be used in user-defined methods, and passed
# to each item's decorator.
#
# source://draper//lib/draper/collection_decorator.rb#17
def context; end
# @return [Hash] extra data to be used in user-defined methods, and passed
# to each item's decorator.
#
# source://draper//lib/draper/collection_decorator.rb#52
def context=(value); end
# source://draper//lib/draper/delegation.rb#10
def count(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def cycle(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def deconstruct(*_arg0, **_arg1, &_arg2); end
# @return [true]
#
# source://draper//lib/draper/collection_decorator.rb#58
def decorated?; end
# @return [Array] the decorated items.
#
# source://draper//lib/draper/collection_decorator.rb#42
def decorated_collection; end
def decorated_with?(_arg0); end
# @return [Class] the decorator class used to decorate each item, as set by
# {#initialize}.
#
# source://draper//lib/draper/collection_decorator.rb#13
def decorator_class; end
# source://draper//lib/draper/delegation.rb#10
def delete(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def delete_at(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def delete_if(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def detect(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def difference(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def dig(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def drop(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def drop_while(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def each(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def each_cons(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def each_entry(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def each_index(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def each_slice(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def each_with_index(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def each_with_object(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def empty?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def entries(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def exclude?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def excluding(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def extract_options!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def fetch(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def fifth(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def fill(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def filter(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def filter!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def filter_map(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def find(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def find_all(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def find_index(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def first(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def flat_map(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def flatten(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def flatten!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def forty_two(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def fourth(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def from(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def grep(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def grep_v(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def group_by(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def in_order_of(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def include?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def including(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def index(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def index_by(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def index_with(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def inject(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def insert(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def intersect?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def intersection(*_arg0, **_arg1, &_arg2); end
# @return [Boolean]
#
# source://draper//lib/draper/collection_decorator.rb#64
def is_a?(klass); end
# source://draper//lib/draper/delegation.rb#10
def join(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def keep_if(*_arg0, **_arg1, &_arg2); end
# @return [Boolean]
#
# source://draper//lib/draper/collection_decorator.rb#64
def kind_of?(klass); end
# source://draper//lib/draper/delegation.rb#10
def last(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def lazy(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def length(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def many?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def map(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def map!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def max(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def max_by(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def maximum(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def member?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def min(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def min_by(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def minimum(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def minmax(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def minmax_by(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def none?(*_arg0, **_arg1, &_arg2); end
# @return the collection being decorated.
#
# source://draper//lib/draper/collection_decorator.rb#9
def object; end
# source://draper//lib/draper/delegation.rb#10
def one?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def pack(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def partition(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def permutation(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def pick(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def place(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def pluck(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def pop(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def prepend(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def product(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def push(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def rassoc(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def reduce(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def reject(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def reject!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def repeated_combination(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def repeated_permutation(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/collection_decorator.rb#70
def replace(other); end
# source://draper//lib/draper/delegation.rb#10
def reverse(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def reverse!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def reverse_each(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def rindex(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def rotate(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def rotate!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def sample(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def second(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def second_to_last(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def select(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def select!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def shelljoin(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def shift(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def shuffle(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def shuffle!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def size(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def slice(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def slice!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def slice_after(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def slice_before(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def slice_when(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def sole(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def sort(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def sort!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def sort_by(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def sort_by!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def sum(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def take(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def take_while(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def tally(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def third(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def third_to_last(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_a(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_ary(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_default_s(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_formatted_s(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_fs(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_h(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/collection_decorator.rb#48
def to_s; end
# source://draper//lib/draper/delegation.rb#10
def to_sentence(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_set(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_xml(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def transpose(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def union(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def uniq(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def uniq!(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def unshift(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def values_at(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def without(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def zip(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def |(*_arg0, **_arg1, &_arg2); end
protected
# Decorates the given item.
#
# source://draper//lib/draper/collection_decorator.rb#78
def decorate_item(item); end
private
# source://draper//lib/draper/collection_decorator.rb#84
def item_decorator; end
class << self
def decorate(*_arg0); end
end
end
# source://draper//lib/draper/compatibility/api_only.rb#2
module Draper::Compatibility; end
# Draper expects your `ApplicationController` to include `ActionView::Rendering`. The
# `ApplicationController` generated by Rails 5 API-only applications (created with
# `rails new --api`) don't by default. However, including `ActionView::Rendering` in
# `ApplicatonController` breaks `render :json` due to `render_to_body` being overridden.
#
# This compatibility patch fixes the issue by restoring the original `render_to_body`
# method after including `ActionView::Rendering`. Ultimately, including `ActionView::Rendering`
# in an ActionController::API may not be supported functionality by Rails (see Rails issue
# for more detail: https://github.com/rails/rails/issues/27211). This hack is meant to be a
# temporary solution until we can find a way to not rely on the controller layer.
#
# source://draper//lib/draper/compatibility/api_only.rb#13
module Draper::Compatibility::ApiOnly
extend ::ActiveSupport::Concern
end
# [Active Job](http://edgeguides.rubyonrails.org/active_job_basics.html) allows you to pass
# ActiveRecord objects to background tasks directly and performs the necessary serialization
# and deserialization. In order to do this, arguments to a background job must implement
# [Global ID](https://github.com/rails/globalid).
#
# This compatibility patch implements Global ID for decorated objects by delegating to the object
# that is decorated. This means you can pass decorated objects to background jobs, but
# the object won't be decorated when it is deserialized. This patch is meant as an intermediate
# fix until we can find a way to deserialize the decorated object correctly.
#
# source://draper//lib/draper/compatibility/global_id.rb#12
module Draper::Compatibility::GlobalID
extend ::ActiveSupport::Concern
include ::GlobalID::Identification
end
# source://draper//lib/draper/configuration.rb#2
module Draper::Configuration
# @yield [_self]
# @yieldparam _self [Draper::Configuration] the object that the method was called on
#
# source://draper//lib/draper/configuration.rb#3
def configure; end
# source://draper//lib/draper/configuration.rb#7
def default_controller; end
# source://draper//lib/draper/configuration.rb#11
def default_controller=(controller); end
# source://draper//lib/draper/configuration.rb#15
def default_query_methods_strategy; end
# source://draper//lib/draper/configuration.rb#19
def default_query_methods_strategy=(strategy); end
end
# Provides shortcuts to decorate objects directly, so you can do
# `@product.decorate` instead of `ProductDecorator.new(@product)`.
#
# This module is included by default into `ActiveRecord::Base` and
# `Mongoid::Document`, but you're using another ORM, or want to decorate
# plain old Ruby objects, you can include it manually.
#
# source://draper//lib/draper/decoratable/equality.rb#2
module Draper::Decoratable
include ::Draper::Decoratable::Equality
extend ::ActiveSupport::Concern
mixes_in_class_methods ::Draper::Decoratable::ClassMethods
# The list of decorators that have been applied to the object.
#
# @return [Array<Class>] `[]`
#
# source://draper//lib/draper/decoratable.rb#33
def applied_decorators; end
# Decorates the object using the inferred {#decorator_class}.
#
# @param options [Hash] see {Decorator#initialize}
#
# source://draper//lib/draper/decoratable.rb#17
def decorate(options = T.unsafe(nil)); end
# Checks if this object is decorated.
#
# @return [false]
#
# source://draper//lib/draper/decoratable.rb#46
def decorated?; end
# Checks if a given decorator has been applied to the object.
#
# @param decorator_class [Class]
# @return [false]
#
# source://draper//lib/draper/decoratable.rb#39
def decorated_with?(decorator_class); end
# Infers the decorator class to be used by {Decoratable#decorate} (e.g.
# `Product` maps to `ProductDecorator`).
#
# @return [Class] the inferred decorator class.
#
# source://draper//lib/draper/decoratable.rb#22
def decorator_class; end
# @return [Boolean]
#
# source://draper//lib/draper/decoratable.rb#26
def decorator_class?; end
end
# source://draper//lib/draper/decoratable.rb#50
module Draper::Decoratable::ClassMethods
# Compares with possibly-decorated objects.
#
# @return [Boolean]
#
# source://draper//lib/draper/decoratable.rb#87
def ===(other); end
# Decorates a collection of objects. Used at the end of a scope chain.
#
# @example
# Product.popular.decorate
# @param options [Hash] see {Decorator.decorate_collection}.
#
# source://draper//lib/draper/decoratable.rb#57
def decorate(options = T.unsafe(nil)); end
# Infers the decorator class to be used by {Decoratable#decorate} (e.g.
# `Product` maps to `ProductDecorator`).
#
# @return [Class] the inferred decorator class.
#
# source://draper//lib/draper/decoratable.rb#71
def decorator_class(called_on = T.unsafe(nil)); end
# @return [Boolean]
#
# source://draper//lib/draper/decoratable.rb#61
def decorator_class?; end
end
# source://draper//lib/draper/decoratable/equality.rb#3
module Draper::Decoratable::Equality
# Compares self with a possibly-decorated object.
#
# @return [Boolean]
#
# source://draper//lib/draper/decoratable/equality.rb#7
def ==(other); end
class << self
# Compares an object to a possibly-decorated object.
#
# @return [Boolean]
#
# source://draper//lib/draper/decoratable/equality.rb#14
def test(object, other); end
# @private
#
# source://draper//lib/draper/decoratable/equality.rb#20
def test_for_decorator(object, other); end
end
end
# @private
#
# source://draper//lib/draper/decorated_association.rb#3
class Draper::DecoratedAssociation
# @return [DecoratedAssociation] a new instance of DecoratedAssociation
#
# source://draper//lib/draper/decorated_association.rb#4
def initialize(owner, association, options); end
# source://draper//lib/draper/decorated_association.rb#17
def call; end
private
# Returns the value of attribute association.
#
# source://draper//lib/draper/decorated_association.rb#24
def association; end
# source://draper//lib/draper/decorated_association.rb#26
def decorate; end
# Returns the value of attribute factory.
#
# source://draper//lib/draper/decorated_association.rb#24
def factory; end
# Returns the value of attribute owner.
#
# source://draper//lib/draper/decorated_association.rb#24
def owner; end
# Returns the value of attribute scope.
#
# source://draper//lib/draper/decorated_association.rb#24
def scope; end
end
# source://draper//lib/draper/decorates_assigned.rb#2
module Draper::DecoratesAssigned
# @overload decorates_assigned
#
# source://draper//lib/draper/decorates_assigned.rb#28
def decorates_assigned(*variables); end
end
# source://draper//lib/draper/decorator.rb#4
class Draper::Decorator
include ::Draper::ViewHelpers
include ::Draper::Compatibility::GlobalID
include ::GlobalID::Identification
include ::ActiveModel::Serialization
include ::ActiveModel::Serializers::JSON
include ::ActiveModel::Serializers::Xml
extend ::Draper::ViewHelpers::ClassMethods
extend ::Draper::Delegation
extend ::ActiveModel::Naming
# Wraps an object in a new instance of the decorator.
#
# Decorators may be applied to other decorators. However, applying a
# decorator to an instance of itself will create a decorator with the same
# source as the original, rather than redecorating the other instance.
#
# @option options
# @param object [Object] object to decorate.
# @param options [Hash] a customizable set of options
# @return [Decorator] a new instance of Decorator
#
# source://draper//lib/draper/decorator.rb#32
def initialize(object, options = T.unsafe(nil)); end
# Compares the source object with a possibly-decorated object.
#
# @return [Boolean]
#
# source://draper//lib/draper/decorator.rb#169
def ==(other); end
# @return [Array<Class>] the list of decorators that have been applied to
# the object.
#
# source://draper//lib/draper/decorator.rb#147
def applied_decorators; end
# implemented by the decorator.
#
# @return [Hash] the object's attributes, sliced to only include those
#
# source://draper//lib/draper/decorator.rb#217
def attributes; end
# source://draper//lib/draper/delegation.rb#10
def blank?(*_arg0, **_arg1, &_arg2); end
# @return [Hash] extra data to be used in user-defined methods.
#
# source://draper//lib/draper/decorator.rb#19
def context; end
# @return [Hash] extra data to be used in user-defined methods.
#
# source://draper//lib/draper/decorator.rb#19
def context=(_arg0); end
# Checks if this object is decorated.
#
# @return [true]
#
# source://draper//lib/draper/decorator.rb#162
def decorated?; end
# Checks if a given decorator has been applied to the object.
#
# @param decorator_class [Class]
# @return [Boolean]
#
# source://draper//lib/draper/decorator.rb#155
def decorated_with?(decorator_class); end
# Delegates equality to :== as expected
#
# @return [Boolean]
#
# source://draper//lib/draper/decorator.rb#176
def eql?(other); end
# Returns a unique hash for a decorated object based on
# the decorator class and the object being decorated.
#
# @return [Fixnum]
#
# source://draper//lib/draper/decorator.rb#184
def hash; end
# source://activemodel/7.0.5/lib/active_model/serializers/json.rb#15
def include_root_in_json; end
# source://activemodel/7.0.5/lib/active_model/serializers/json.rb#15
def include_root_in_json?; end
# Checks if `self.instance_of?(klass)` or `object.instance_of?(klass)`
#
# @param klass [Class]
# @return [Boolean]
#
# source://draper//lib/draper/decorator.rb#200
def instance_of?(klass); end
# Checks if `self.kind_of?(klass)` or `object.kind_of?(klass)`
#
# @param klass [Class]
# @return [Boolean]
#
# source://draper//lib/draper/decorator.rb#191
def is_a?(klass); end
# Checks if `self.kind_of?(klass)` or `object.kind_of?(klass)`
#
# @param klass [Class]
# @return [Boolean]
#
# source://draper//lib/draper/decorator.rb#191
def kind_of?(klass); end
# @return the object being decorated.
#
# source://draper//lib/draper/decorator.rb#14
def model; end
# source://draper//lib/draper/delegation.rb#10
def model_name(*_arg0, **_arg1, &_arg2); end
# @return the object being decorated.
#
# source://draper//lib/draper/decorator.rb#14
def object; end
# source://draper//lib/draper/delegation.rb#10
def present?(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/compatibility/global_id.rb#18
def to_global_id(*_arg0, **_arg1, &_arg2); end
# ActiveModel compatibility
#
# @private
#
# source://draper//lib/draper/decorator.rb#211
def to_model; end
# source://draper//lib/draper/delegation.rb#10
def to_param(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_partial_path(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/delegation.rb#10
def to_s(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/compatibility/global_id.rb#18
def to_signed_global_id(*_arg0, **_arg1, &_arg2); end
private
# source://draper//lib/draper/decorator.rb#275
def decorated_associations; end
# source://draper//lib/draper/decorator.rb#266
def handle_multiple_decoration(options); end
class << self
# source://draper//lib/draper/decorator.rb#242
def alias_object_to_object_class_name; end
# @return [Class] the class created by {decorate_collection}.
#
# source://draper//lib/draper/decorator.rb#228
def collection_decorator_class; end
# source://draper//lib/draper/decorator.rb#259
def collection_decorator_name; end
def decorate(*_arg0); end
# Decorates a collection of objects. The class of the collection decorator
# is inferred from the decorator class if possible (e.g. `ProductDecorator`
# maps to `ProductsDecorator`), but otherwise defaults to
# {Draper::CollectionDecorator}.
#
# @option options
# @option options
# @param object [Object] collection to decorate.
# @param options [Hash] a customizable set of options
#
# source://draper//lib/draper/decorator.rb#140
def decorate_collection(object, options = T.unsafe(nil)); end
# Sets the source class corresponding to the decorator class.
#
# @note This is only necessary if you wish to proxy class methods to the
# source (including when using {decorates_finders}), and the source class
# cannot be inferred from the decorator class (e.g. `ProductDecorator`
# maps to `Product`).
# @param object_class [String, Symbol, Class] source class (or class name) that corresponds to this decorator.
# @return [void]
#
# source://draper//lib/draper/decorator.rb#60
def decorates(object_class); end
# Automatically decorate an association.
#
# @option options
# @option options
# @option options
# @param association [Symbol] name of the association to decorate (e.g. `:products`).
# @param options [Hash] a customizable set of options
# @return [void]
#
# source://draper//lib/draper/decorator.rb#106
def decorates_association(association, options = T.unsafe(nil)); end
# @overload decorates_associations
#
# source://draper//lib/draper/decorator.rb#121
def decorates_associations(*associations); end
# Automatically decorates ActiveRecord finder methods, so that you can use
# `ProductDecorator.find(id)` instead of
# `ProductDecorator.decorate(Product.find(id))`.
#
# Finder methods are applied to the {object_class}.
#
# @return [void]
#
# source://draper//lib/draper/decorator.rb#88
def decorates_finders; end
# Automatically delegates instance methods to the source object. Class
# methods will be delegated to the {object_class}, if it is set.
#
# @return [void]
#
# source://draper//lib/draper/decorator.rb#47
def delegate_all; end
# source://activemodel/7.0.5/lib/active_model/serializers/json.rb#15
def include_root_in_json; end
# source://activemodel/7.0.5/lib/active_model/serializers/json.rb#15
def include_root_in_json=(value); end
# source://activemodel/7.0.5/lib/active_model/serializers/json.rb#15
def include_root_in_json?; end
# @raise [Draper::UninferrableObjectError]
#
# source://draper//lib/draper/decorator.rb#251
def inferred_object_class; end
# @private
#
# source://draper//lib/draper/decorator.rb#237
def inherited(subclass); end
# source://draper//lib/draper/decorator.rb#225
def model_name(*_arg0, **_arg1, &_arg2); end
# Returns the source class corresponding to the decorator class, as set by
# {decorates}, or as inferred from the decorator class name (e.g.
# `ProductDecorator` maps to `Product`).
#
# @return [Class] the source class that corresponds to this decorator.
#
# source://draper//lib/draper/decorator.rb#70
def object_class; end
# Checks whether this decorator class has a corresponding {object_class}.
#
# @return [Boolean]
#
# source://draper//lib/draper/decorator.rb#75
def object_class?; end
# source://draper//lib/draper/decorator.rb#246
def object_class_name; end
end
end
# source://draper//lib/draper/delegation.rb#2
module Draper::Delegation
# @overload delegate
#
# source://draper//lib/draper/delegation.rb#8
def delegate(*methods); end
end
# source://draper//lib/draper/factory.rb#2
class Draper::Factory
# Creates a decorator factory.
#
# @option options
# @option options
# @param options [Hash] a customizable set of options
# @return [Factory] a new instance of Factory
#
# source://draper//lib/draper/factory.rb#12
def initialize(options = T.unsafe(nil)); end
# Decorates an object, inferring whether to create a singular or collection
# decorator from the type of object passed.
#
# @option options
# @option options
# @param object [Object] object to decorate.
# @param options [Hash] a customizable set of options
# @return [Decorator, CollectionDecorator] the decorated object.
#
# source://draper//lib/draper/factory.rb#29
def decorate(object, options = T.unsafe(nil)); end
private
# Returns the value of attribute decorator_class.
#
# source://draper//lib/draper/factory.rb#36
def decorator_class; end
# Returns the value of attribute default_options.
#
# source://draper//lib/draper/factory.rb#36
def default_options; end
end
# @private
#
# source://draper//lib/draper/factory.rb#39
class Draper::Factory::Worker
# @return [Worker] a new instance of Worker
#
# source://draper//lib/draper/factory.rb#40
def initialize(decorator_class, object); end
# source://draper//lib/draper/factory.rb#45
def call(options); end
# @raise [Draper::UninferrableDecoratorError]
#
# source://draper//lib/draper/factory.rb#50
def decorator; end
private
# @return [Boolean]
#
# source://draper//lib/draper/factory.rb#77
def collection?; end
# @return [Boolean]
#
# source://draper//lib/draper/factory.rb#81
def decoratable?; end
# Returns the value of attribute decorator_class.
#
# source://draper//lib/draper/factory.rb#59
def decorator_class; end
# source://draper//lib/draper/factory.rb#69
def decorator_method(klass); end
# Returns the value of attribute object.
#
# source://draper//lib/draper/factory.rb#59
def object; end
# source://draper//lib/draper/factory.rb#61
def object_decorator; end
# source://draper//lib/draper/factory.rb#85
def update_context(options); end
end
# Provides automatically-decorated finder methods for your decorators. You
# do not have to extend this module directly; it is extended by
# {Decorator.decorates_finders}.
#
# source://draper//lib/draper/finders.rb#5
module Draper::Finders
# source://draper//lib/draper/finders.rb#10
def all(options = T.unsafe(nil)); end
# source://draper//lib/draper/finders.rb#6
def find(id, options = T.unsafe(nil)); end
# source://draper//lib/draper/finders.rb#14
def first(options = T.unsafe(nil)); end
# source://draper//lib/draper/finders.rb#18
def last(options = T.unsafe(nil)); end
# Decorates dynamic finder methods (`find_all_by_` and friends).
#
# source://draper//lib/draper/finders.rb#23
def method_missing(method, *args, &block); end
end
# Provides access to helper methods - both Rails built-in helpers, and those
# defined in your application.
#
# source://draper//lib/draper/helper_proxy.rb#4
class Draper::HelperProxy
# @overload initialize
# @return [HelperProxy] a new instance of HelperProxy
#
# source://draper//lib/draper/helper_proxy.rb#6
def initialize(view_context); end
# source://draper//lib/draper/helper_proxy.rb#22
def capture(*_arg0, **_arg1, &_arg2); end
# source://draper//lib/draper/helper_proxy.rb#11
def method_missing(method, *args, **_arg2, &block); end
protected
# Returns the value of attribute view_context.
#
# source://draper//lib/draper/helper_proxy.rb#26
def view_context; end
private
# Checks if the context responds to an instance method, or is able to
# proxy it to the view context.
#
# @return [Boolean]
#
# source://draper//lib/draper/helper_proxy.rb#18
def respond_to_missing?(method, include_private = T.unsafe(nil)); end
class << self
# source://draper//lib/draper/helper_proxy.rb#30
def define_proxy(name); end
end
end
# source://draper//lib/draper/helper_support.rb#1
module Draper::HelperSupport
# source://draper//lib/draper/helper_support.rb#2
def decorate(input, &block); end
end
# Include this module in your decorators to get direct access to the helpers
# so that you can stop typing `h.` everywhere, at the cost of mixing in a
# bazillion methods.
#
# source://draper//lib/draper/lazy_helpers.rb#5
module Draper::LazyHelpers
# source://draper//lib/draper/lazy_helpers.rb#7
def method_missing(method, *args, **_arg2, &block); end
end
# source://draper//lib/draper/query_methods/load_strategy.rb#2
module Draper::QueryMethods
# source://draper//lib/draper/query_methods.rb#6
def method_missing(method, *args, **_arg2, &block); end
private
# @return [Boolean]
#
# source://draper//lib/draper/query_methods.rb#12
def respond_to_missing?(method, include_private = T.unsafe(nil)); end
# Configures the strategy used to proxy the query methods, which defaults to `:active_record`.
#
# source://draper//lib/draper/query_methods.rb#19
def strategy; end
end
# source://draper//lib/draper/query_methods/load_strategy.rb#3
module Draper::QueryMethods::LoadStrategy
class << self
# source://draper//lib/draper/query_methods/load_strategy.rb#4
def new(name); end
end
end
# source://draper//lib/draper/query_methods/load_strategy.rb#8
class Draper::QueryMethods::LoadStrategy::ActiveRecord
# @return [Boolean]
#
# source://draper//lib/draper/query_methods/load_strategy.rb#9
def allowed?(method); end
end
# source://draper//lib/draper/query_methods/load_strategy.rb#14
class Draper::QueryMethods::LoadStrategy::Mongoid
# @raise [NotImplementedError]
# @return [Boolean]
#
# source://draper//lib/draper/query_methods/load_strategy.rb#15
def allowed?(method); end
end
# source://draper//lib/draper/railtie.rb#13
class Draper::Railtie < ::Rails::Railtie
# source://draper//lib/draper/railtie.rb#49
def initialize_view_context; end
end
# source://draper//lib/draper.rb#60
class Draper::UninferrableDecoratorError < ::NameError
# @return [UninferrableDecoratorError] a new instance of UninferrableDecoratorError
#
# source://draper//lib/draper.rb#61
def initialize(klass); end
end
# source://draper//lib/draper.rb#66
class Draper::UninferrableObjectError < ::NameError
# @return [UninferrableObjectError] a new instance of UninferrableObjectError
#
# source://draper//lib/draper.rb#67
def initialize(klass); end
end
# source://draper//lib/draper/version.rb#2
Draper::VERSION = T.let(T.unsafe(nil), String)
# source://draper//lib/draper/view_context/build_strategy.rb#2
module Draper::ViewContext
# Set the current controller
#
# source://draper//lib/draper/view_context.rb#14
def activate_draper; end
# Hooks into a controller or mailer to save the view context in {current}.
#
# source://draper//lib/draper/view_context.rb#7
def view_context; end
class << self
# Builds a new view context for usage in tests. See {test_strategy} for
# details of how the view context is built.
#
# source://draper//lib/draper/view_context.rb#50
def build; end
# Builds a new view context and sets it as the current view context.
#
# @return [HelperProxy]
#
# source://draper//lib/draper/view_context.rb#57
def build!; end
# @private
#
# source://draper//lib/draper/view_context.rb#84
def build_strategy; end
# Clears the saved controller and view context.
#
# source://draper//lib/draper/view_context.rb#43
def clear!; end
# Returns the current controller.
#
# source://draper//lib/draper/view_context.rb#19
def controller; end
# Sets the current controller. Clears view context when we are setting
# different controller.
#
# source://draper//lib/draper/view_context.rb#25
def controller=(controller); end
# Returns the current view context, or builds one if none is saved.
#
# @return [HelperProxy]
#
# source://draper//lib/draper/view_context.rb#33
def current; end
# Sets the current view context.
#
# source://draper//lib/draper/view_context.rb#38
def current=(view_context); end
# Configures the strategy used to build view contexts in tests, which
# defaults to `:full` if `test_strategy` has not been called. Evaluates
# the block, if given, in the context of the view context's class.
#
# @example Pass a block to add helper methods to the view context:
# Draper::ViewContext.test_strategy :fast do
# include ApplicationHelper
# end
# @param name [:full, :fast] the strategy to use:
#
# `:full` - build a fully-working view context. Your Rails environment
# must be loaded, including your `ApplicationController`.
#
# `:fast` - build a minimal view context in tests, with no dependencies
# on other components of your application.
#
# source://draper//lib/draper/view_context.rb#79
def test_strategy(name, &block); end
end
end
# @private
#
# source://draper//lib/draper/view_context/build_strategy.rb#4
module Draper::ViewContext::BuildStrategy
class << self
# source://draper//lib/draper/view_context/build_strategy.rb#5
def new(name, &block); end
end
end
# source://draper//lib/draper/view_context/build_strategy.rb#9
class Draper::ViewContext::BuildStrategy::Fast
# @return [Fast] a new instance of Fast
#
# source://draper//lib/draper/view_context/build_strategy.rb#10
def initialize(&block); end
# source://draper//lib/draper/view_context/build_strategy.rb#14
def call; end
private
# Returns the value of attribute view_context_class.
#
# source://draper//lib/draper/view_context/build_strategy.rb#20
def view_context_class; end
end
# source://draper//lib/draper/view_context/build_strategy.rb#23
class Draper::ViewContext::BuildStrategy::Full
# @return [Full] a new instance of Full
#
# source://draper//lib/draper/view_context/build_strategy.rb#24
def initialize(&block); end
# source://draper//lib/draper/view_context/build_strategy.rb#28
def call; end
private
# Returns the value of attribute block.
#
# source://draper//lib/draper/view_context/build_strategy.rb#36
def block; end
# source://draper//lib/draper/view_context/build_strategy.rb#38
def controller; end
# source://draper//lib/draper/view_context/build_strategy.rb#49
def is_above_rails_5_1; end
# source://draper//lib/draper/view_context/build_strategy.rb#45
def new_test_request(controller); end
end
# Provides the {#helpers} method used in {Decorator} and {CollectionDecorator}
# to call the Rails helpers.
#
# source://draper//lib/draper/view_helpers.rb#4
module Draper::ViewHelpers
extend ::ActiveSupport::Concern
mixes_in_class_methods ::Draper::ViewHelpers::ClassMethods
# Access the helpers proxy to call built-in and user-defined
# Rails helpers. Aliased to `h` for convenience.
#
# @return [HelperProxy] the helpers proxy
#
# source://draper//lib/draper/view_helpers.rb#23
def h; end
# Access the helpers proxy to call built-in and user-defined
# Rails helpers. Aliased to `h` for convenience.
#
# @return [HelperProxy] the helpers proxy
#
# source://draper//lib/draper/view_helpers.rb#23
def helpers; end
# source://draper//lib/draper/view_helpers.rb#31
def l(*args, **_arg1); end
# source://draper//lib/draper/view_helpers.rb#31
def localize(*args, **_arg1); end
end
# source://draper//lib/draper/view_helpers.rb#7
module Draper::ViewHelpers::ClassMethods
# Access the helpers proxy to call built-in and user-defined
# Rails helpers from a class context.
#
# @return [HelperProxy] the helpers proxy
#
# source://draper//lib/draper/view_helpers.rb#12
def h; end
# Access the helpers proxy to call built-in and user-defined
# Rails helpers from a class context.
#
# @return [HelperProxy] the helpers proxy
#
# source://draper//lib/draper/view_helpers.rb#12
def helpers; end
end