Class: Dirwatch::Options
- Defined in:
- lib/dirwatch/options.rb,
lib/dirwatch/options/parser.rb
Defined Under Namespace
Classes: InitParser, Parser, WatchParser
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(action, options) ⇒ Options
constructor
A new instance of Options.
- #method_missing(m, *args, &block) ⇒ Object
- #respond_to_missing?(m, include_private = false) ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(action, options) ⇒ Options
Returns a new instance of Options.
15 16 17 18 |
# File 'lib/dirwatch/options.rb', line 15 def initialize action, @action = action.to_sym = send "#{@action}_options", end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
24 25 26 27 |
# File 'lib/dirwatch/options.rb', line 24 def method_missing m, *args, &block return [m] if && .key?(m) super end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
13 14 15 |
# File 'lib/dirwatch/options.rb', line 13 def action @action end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/dirwatch/options.rb', line 13 def end |
Class Method Details
.from_args(args) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/dirwatch/options.rb', line 6 def self.from_args args parser = Parser.from_args args parser.parse! args new parser.action, parser..to_h end |
Instance Method Details
#respond_to_missing?(m, include_private = false) ⇒ Boolean
29 30 31 |
# File 'lib/dirwatch/options.rb', line 29 def respond_to_missing? m, include_private = false ( && .key?(m)) || super end |
#to_h ⇒ Object
20 21 22 |
# File 'lib/dirwatch/options.rb', line 20 def to_h end |