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.
55 56 57 |
# File 'lib/mvcli/router.rb', line 55 def initialize() @pattern, @expansion = .first end |
Instance Method Details
#expand(argv) ⇒ Object
59 60 61 |
# File 'lib/mvcli/router.rb', line 59 def (argv) argv.join(" ").gsub(@pattern, @expansion).split /\s+/ end |