Module: FactoryBot::ExampleBot
- Includes:
- Api::OpenApiHelper
- Included in:
- FactoryBot
- Defined in:
- lib/bullet_train/api/example_bot.rb
Constant Summary collapse
- REST_METHODS =
standard:enable Style/ArgumentsForwarding
%i[get_examples get_example post_example post_parameters put_example put_parameters patch_example patch_parameters]
Instance Method Summary collapse
-
#example(model, **options) ⇒ Object
Anonymous argument forwarding is a new feature in Ruby 3.2 and trying to use it breaks things when people are using an older verison of Ruby.
- #example_list(model, quantity, **options) ⇒ Object
Methods included from Api::OpenApiHelper
#automatic_components_for, #automatic_paths_for, #current_model, #description_for, #external_doc, #for_model, #gem_paths, #indent, #paths_for, #process_strong_parameters, #strong_parameter_keys_for
Instance Method Details
#example(model, **options) ⇒ Object
Anonymous argument forwarding is a new feature in Ruby 3.2 and trying to use it breaks things when people are using an older verison of Ruby. So for now we’re silencing the linter complaints and are using named arguments. standard:disable Style/ArgumentsForwarding
9 10 11 |
# File 'lib/bullet_train/api/example_bot.rb', line 9 def example(model, **) FactoryBot.build(factory(model), **) end |
#example_list(model, quantity, **options) ⇒ Object
13 14 15 |
# File 'lib/bullet_train/api/example_bot.rb', line 13 def example_list(model, quantity, **) FactoryBot.build_list(factory(model), quantity, **) end |