Class: RubyToBlock::Block::RubyStatement

Inherits:
Base
  • Object
show all
Defined in:
app/models/concerns/ruby_to_block.rb

Instance Attribute Summary

Attributes inherited from Base

#fields, #parent, #sibling, #statements, #values

Instance Method Summary collapse

Methods inherited from Base

#[], #add_statement, #indent?, #indent_level, #initialize, #inline?, #null?, #to_xml, #type

Constructor Details

This class inherits a constructor from RubyToBlock::Block::Base

Instance Method Details

#parent=(block) ⇒ Object



377
378
379
380
381
382
# File 'app/models/concerns/ruby_to_block.rb', line 377

def parent=(block)
  @parent = block
  @original_statement ||= @fields[:STATEMENT]
  @fields[:STATEMENT] =
    @original_statement.sub(/^ {0,#{indent_level * 2}}/, '')
end