Class: Factorix::CLI::Commands::MOD::Search
- Inherits:
-
Base
- Object
- Dry::CLI::Command
- Base
- Factorix::CLI::Commands::MOD::Search
- Includes:
- PortalSupport
- Defined in:
- lib/factorix/cli/commands/mod/search.rb,
sig/factorix/cli/commands/mod/search.rbs
Overview
Search MODs on Factorio MOD Portal
Instance Attribute Summary collapse
-
#portal ⇒ Portal
readonly
Returns the value of attribute portal.
-
#runtime ⇒ Runtime
readonly
Returns the value of attribute runtime.
Instance Method Summary collapse
-
#call(mod_names: [], hide_deprecated: true, page: "1", page_size: "25", sort: nil, sort_order: nil, version: nil, json: false) ⇒ void
Execute the search command.
Methods inherited from Base
backup_support!, confirmable!, inherited, require_game_stopped!
Instance Attribute Details
#portal ⇒ Portal (readonly)
Returns the value of attribute portal.
10 11 12 |
# File 'sig/factorix/cli/commands/mod/search.rbs', line 10 def portal @portal end |
#runtime ⇒ Runtime (readonly)
Returns the value of attribute runtime.
11 12 13 |
# File 'sig/factorix/cli/commands/mod/search.rbs', line 11 def runtime @runtime end |
Instance Method Details
#call(mod_names: [], hide_deprecated: true, page: "1", page_size: "25", sort: nil, sort_order: nil, version: nil, json: false) ⇒ void
This method returns an undefined value.
Execute the search command
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/factorix/cli/commands/mod/search.rb', line 49 def call(mod_names: [], hide_deprecated: true, page: "1", page_size: "25", sort: nil, sort_order: nil, version: nil, json: false, **) page = Integer(page) page_size = Integer(page_size) version ||= default_factorio_version mods = portal.list_mods(*mod_names, hide_deprecated: hide_deprecated || nil, page:, page_size:, sort:, sort_order:, version:) if json output_json(mods) else output_table(mods) end end |