Are you an LLM? You can read better optimized documentation at /guide/actions/options.md for this page in Markdown format
Options for actions
Option if
Checks the if condition before calling the method.
ruby
make :something,
if: ->(context:) { Settings.features.preview.enabled }
def something
# ...
endOption unless
The opposite of the if option.
ruby
make :something,
unless: ->(context:) { Settings.features.preview.disabled }
def something
# ...
endOption position
All methods have a position. Use position to call a method at a different time than it was added via make. Useful for service inheritance.
ruby
class SomeApiService::Base < ApplicationService::Base
make :api_request!,
position: 2
# ...
end
class SomeApiService::Posts::Create < SomeApiService::Base
input :post_name, type: String
# ...
make :validate!,
position: 1
private
def validate!
# ...
end
# ...
end