Class: RubocopPr::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_pr/options.rb

Overview

Parse the options from the command line

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Options

Returns a new instance of Options.



8
9
10
11
# File 'lib/rubocop_pr/options.rb', line 8

def initialize(args)
  @args = args
  @options = OpenStruct.new
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



6
7
8
# File 'lib/rubocop_pr/options.rb', line 6

def args
  @args
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/rubocop_pr/options.rb', line 6

def options
  @options
end

Instance Method Details

#parseObject



13
14
15
16
# File 'lib/rubocop_pr/options.rb', line 13

def parse
  build_parser.parse!(args)
  options
end