Module: Hg::Utils
- Defined in:
- lib/hg/utils.rb
Class Method Summary collapse
-
.extract_options(args) ⇒ Object
Extract options hash from an array argument.
- .extract_options!(args) ⇒ Object
Class Method Details
.extract_options(args) ⇒ Object
Extract options hash from an array argument.
10 11 12 13 |
# File 'lib/hg/utils.rb', line 10 def (args) = args.last .respond_to?(:to_hash) ? .to_hash.dup : {} end |
.extract_options!(args) ⇒ Object
15 16 17 |
# File 'lib/hg/utils.rb', line 15 def (args) args.last.respond_to?(:to_hash) ? args.pop : {} end |