Class: WebammToRails::Sources::Views::Devise::Standard::Presenter

Inherits:
Object
  • Object
show all
Defined in:
lib/webamm_to_rails/sources/views/devise/standard/presenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(table_name:) ⇒ Presenter

Returns a new instance of Presenter.



7
8
9
# File 'lib/webamm_to_rails/sources/views/devise/standard/presenter.rb', line 7

def initialize(table_name:)
  @table_name = table_name
end

Instance Method Details

#collectionObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/webamm_to_rails/sources/views/devise/standard/presenter.rb', line 11

def collection
  base_path = "app/views/#{@table_name}/"
  templates = [
    'confirmations/new.html.erb',
    'mailer/confirmation_instructions.html.erb',
    'mailer/reset_password_instructions.html.erb',
    'mailer/email_changed.html.erb',
    'mailer/password_change.html.erb',
    'passwords/edit.html.erb',
    'passwords/new.html.erb',
    'registrations/edit.html.erb',
    'registrations/new.html.erb',
    'sessions/new.html.erb',
    'shared/_links.html.erb'
  ]

  templates.map do |template|
    {
      path: base_path + template,
      content: File.read(File.expand_path("templates/#{template}", __dir__))
    }
  end
end