Class: EmailTemplatesFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/email_templates_finder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ EmailTemplatesFinder

Returns a new instance of EmailTemplatesFinder.



12
13
14
15
16
17
# File 'lib/email_templates_finder.rb', line 12

def initialize(obj)
  @obj = obj
  @list = []
  check(@obj, "")
  @list.sort!
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



10
11
12
# File 'lib/email_templates_finder.rb', line 10

def list
  @list
end

Class Method Details

.listObject



4
5
6
7
8
# File 'lib/email_templates_finder.rb', line 4

def self.list
  path = File.join(Rails.root, "config", "locales", "server.en.yml")
  yaml = YAML.load_file(path, aliases: true)
  new(yaml).list
end