Class: DevScripts::Support::BlockExpander

Inherits:
Object
  • Object
show all
Defined in:
lib/dev_scripts/support/block_expander.rb

Instance Method Summary collapse

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

#runObject



12
13
14
# File 'lib/dev_scripts/support/block_expander.rb', line 12

def run
  line_one + line_two + line_three  
end