Module: RubyMutator

Defined in:
lib/rails3_artifactor/base/crud/create.rb

Instance Method Summary collapse

Instance Method Details

#inherit_from(superclass) ⇒ Object



6
7
8
# File 'lib/rails3_artifactor/base/crud/create.rb', line 6

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

#remove_superclassObject



2
3
4
# File 'lib/rails3_artifactor/base/crud/create.rb', line 2

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