Class: Pipewrench::Options

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#compactObject (readonly)

Returns the value of attribute compact.



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

def compact
  @compact
end

#mapObject (readonly)

Returns the value of attribute map.



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

def map
  @map
end

#railsObject (readonly)

Returns the value of attribute rails.



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

def rails
  @rails
end

#stripObject (readonly)

Returns the value of attribute strip.



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

def strip
  @strip
end

Instance Method Details

#helpObject



20
21
22
23
# File 'lib/pipewrench/options.rb', line 20

def help
  puts self
  exit
end

#parse!(*args) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/pipewrench/options.rb', line 8

def parse!(*args)
  parser.parse!(*args)
  self
rescue OptionParser::InvalidOption => e
  puts e
  help
end

#to_sObject



16
17
18
# File 'lib/pipewrench/options.rb', line 16

def to_s
  parser.to_s
end