Class: BuPr::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/bu_pr/command.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Command

Returns a new instance of Command.

Parameters:

  • args (Array<String>)


19
20
21
22
# File 'lib/bu_pr/command.rb', line 19

def initialize args
  @args = args
  @opts = {}
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



15
16
17
# File 'lib/bu_pr/command.rb', line 15

def args
  @args
end

#optsObject (readonly)

Returns the value of attribute opts.



16
17
18
# File 'lib/bu_pr/command.rb', line 16

def opts
  @opts
end

Class Method Details

.start(args) ⇒ Object

Note:

for backward compatibility

Entry Point



10
11
12
13
# File 'lib/bu_pr/command.rb', line 10

def self.start args
  Runner.call \
    new(args).parse
end

Instance Method Details

#parseHash<Symbol, String>

Returns:

  • (Hash<Symbol, String>)


25
26
27
28
# File 'lib/bu_pr/command.rb', line 25

def parse
  parser.parse! args
  opts
end