class PfeedCustomizationGenerator

Attributes

past_classname[R]
past_varname[R]

Public Instance Methods

initialize_pfeed_customization() click to toggle source
# File lib/generator/pfeed_customization/pfeed_customization_generator.rb, line 9
def initialize_pfeed_customization
  raise "#{model.to_s.classify} must define '#{action_name.underscore}' method" unless model.to_s.classify.constantize.methods.include? action_name.underscore
  
  @model = model
  @current_action = action_name.to_s.underscore
  @past_action = ParolkarInnovationLab::SocialNet::PfeedUtils.attempt_pass_tense(@current_action)
  @past = @model.downcase + '_' + @past_action
  @past_classname = @model.capitalize + @past_action.capitalize
  @past_varname = @model.downcase + '_' + @past_action.downcase
  @model_filename =  @past + '.rb'
  @view_filename = '_' + @past + '.html.erb'
end
manifest() click to toggle source
# File lib/generator/pfeed_customization/pfeed_customization_generator.rb, line 22
def manifest
  template('pfeed_model.rb', "app/models/pfeeds/#{@model_filename}")
  template('pfeed_view.html.erb', "app/views/pfeeds/#{@view_filename}")
 
end