Class: Gimp::Options

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

Instance Method Summary collapse

Constructor Details

#initialize(defaults) ⇒ Options

Returns a new instance of Options.



3
4
5
# File 'lib/gimp/options.rb', line 3

def initialize(defaults)
  super(@options = Hashie::Mash.new(defaults))
end

Instance Method Details

#parse!(args) ⇒ Object



7
8
9
10
# File 'lib/gimp/options.rb', line 7

def parse!(args)
  parser.parse!(args)
  self
end

#usageObject



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

def usage
  parser.to_s
end

#valid?Boolean

Returns:



12
13
14
# File 'lib/gimp/options.rb', line 12

def valid?
  @options.token? && @options.source? && @options.destination? && @options.issues?
end