Class: Gimp::Options
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Gimp::Options
- Defined in:
- lib/gimp/options.rb
Instance Method Summary collapse
-
#initialize(defaults) ⇒ Options
constructor
A new instance of Options.
- #parse!(args) ⇒ Object
- #usage ⇒ Object
- #valid? ⇒ Boolean
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 |
#usage ⇒ Object
16 17 18 |
# File 'lib/gimp/options.rb', line 16 def usage parser.to_s end |
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/gimp/options.rb', line 12 def valid? @options.token? && @options.source? && @options.destination? && @options.issues? end |