Add some documentation to NestedResource module

This commit is contained in:
Brandur 2017-10-17 17:52:35 -07:00
parent cf5354cc27
commit af51af2577

View File

@ -1,5 +1,12 @@
module Stripe
module APIOperations
# Adds methods to help manipulate a subresource from its parent resource so
# that it's possible to do so from a static context (i.e. without a
# pre-existing collection of subresources on the parent).
#
# For examle, a transfer gains the static methods for reversals so that the
# methods `.create_reversal`, `.retrieve_reversal`, `.update_reversal`,
# etc. all become available.
module NestedResource
def nested_resource_class_methods(resource, path: nil, operations: nil)
path ||= "#{resource}s"