Class: MVCLI::Router::Macro
- Inherits:
-
Object
- Object
- MVCLI::Router::Macro
- Defined in:
- lib/mvcli/router.rb
Instance Method Summary collapse
- #expand(argv) ⇒ Object
-
#initialize(options) ⇒ Macro
constructor
A new instance of Macro.
Constructor Details
#initialize(options) ⇒ Macro
Returns a new instance of Macro.
39 40 41 |
# File 'lib/mvcli/router.rb', line 39 def initialize() @pattern, @expansion = .first end |
Instance Method Details
#expand(argv) ⇒ Object
43 44 45 |
# File 'lib/mvcli/router.rb', line 43 def (argv) argv.join(" ").gsub(@pattern, @expansion).split /\s+/ end |