Class: Ea::Cli::Command::Query
Overview
ea query FILE [--type=T] [--package=NAME] [--stereo=NAME]
Wraps Ea::Query::Builder for CLI consumption.
Constant Summary collapse
- COLUMNS =
%i[id type name package].freeze
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Ea::Cli::Command::Base
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/ea/cli/command/query.rb', line 12 def call builder = Ea::Query::Builder.new(model) builder = builder.with_type([:type]) if [:type] builder = builder.in_package([:package]) if [:package] builder = builder.with_stereotype([:stereotype]) if [:stereotype] rows = builder.call.map { |o| [o.object_id, o.object_type, o.name, package_name_for(o)] } formatter.render(rows, columns: COLUMNS) end |