Module: Rubyists::Linear::CLI::CommonOptions
- Included in:
- Console, Issue::Create, Issue::Develop, Issue::List, Issue::Pr, Issue::Take, Issue::Update, Team::List, Version, WhoAmI
- Defined in:
- lib/linear/cli/common_options.rb
Overview
The CommonOptions module contains common options for all commands
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#display(subject, options) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/linear/cli/common_options.rb', line 14 def display(subject, ) return puts(JSON.pretty_generate(subject)) if [:output] == 'json' return subject.each { |s| s.display() } if subject.respond_to?(:each) unless subject.respond_to?(:display) raise SmellsBad, "Cannot display #{subject}, there is no #display method and it is not a collection" end subject.display() end |