Module: RailsAssist::RubyMutator

Defined in:
lib/rails_artifactor/ruby_mutator.rb

Instance Method Summary collapse

Instance Method Details

#inherit_from(superclass) ⇒ Object



7
8
9
# File 'lib/rails_artifactor/ruby_mutator.rb', line 7

def inherit_from superclass
  self.gsub! /(class\s+(\w|::)+)/, '\1' + " < #{superclass.to_s.camelize}\n"
end

#remove_superclassObject



3
4
5
# File 'lib/rails_artifactor/ruby_mutator.rb', line 3

def remove_superclass
  self.gsub! /(class\s+\w+\s*)<\s*(\w|::)+/, '\1'
end