Class: DevScripts::Support::BlockExpander
- Inherits:
-
Object
- Object
- DevScripts::Support::BlockExpander
- Defined in:
- lib/dev_scripts/support/block_expander.rb
Instance Method Summary collapse
-
#initialize(line:) ⇒ BlockExpander
constructor
A new instance of BlockExpander.
- #run ⇒ Object
Constructor Details
#initialize(line:) ⇒ BlockExpander
Returns a new instance of BlockExpander.
5 6 7 8 9 10 |
# File 'lib/dev_scripts/support/block_expander.rb', line 5 def initialize(line:) @line = line @body = line.match(/\{.*}\s*\n*\z/)&.send(:[], 0) @spacing = line.match(/\A\s*/)&.send(:[], 0) @argument = line.match(/\|\w+(,\w+)*\|/)&.send(:[], 0) end |
Instance Method Details
#run ⇒ Object
12 13 14 |
# File 'lib/dev_scripts/support/block_expander.rb', line 12 def run line_one + line_two + line_three end |