Class: Sesc::Cli
- Inherits:
-
Object
- Object
- Sesc::Cli
- Includes:
- Options
- Defined in:
- lib/sesc/cli.rb,
lib/sesc/cli/filter.rb,
lib/sesc/cli/options.rb
Defined Under Namespace
Constant Summary
Constants included from Options
Options::COMMANDS_WITH_OPTIONS, Options::DEFAULT
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args) ⇒ Cli
constructor
A new instance of Cli.
Methods included from Options
Constructor Details
#initialize(args) ⇒ Cli
Returns a new instance of Cli.
9 10 11 |
# File 'lib/sesc/cli.rb', line 9 def initialize(args) self.args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
7 8 9 |
# File 'lib/sesc/cli.rb', line 7 def args @args end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sesc/cli.rb', line 13 def call return Sesc::Exporter::Help.print if help? if places? Sesc::Exporter::Places.print elsif Sesc::Cities.include?(city) Sesc.send(city, number, places) else Sesc::Exporter::Printer.new("Cidade #{city} não encontrada").terminal end end |