Conditions | 4 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | 1 | module Textris |
|
5 | 1 | def get |
|
6 | 7 | methods = Rails.application.config.try(:textris_delivery_method) |
|
7 | 7 | methods = [*methods].compact |
|
8 | 7 | if methods.blank? |
|
9 | 3 | if Rails.env.development? |
|
10 | 1 | methods = [:log] |
|
11 | 2 | elsif Rails.env.test? |
|
12 | 1 | methods = [:test] |
|
13 | else |
||
14 | 1 | methods = [:mail] |
|
15 | end |
||
16 | end |
||
17 | |||
18 | methods.map do |method| |
||
19 | "Textris::Delivery::#{method.to_s.camelize}".safe_constantize || |
||
20 | 8 | "#{method.to_s.camelize}Delivery".safe_constantize |
|
21 | 7 | end.compact |
|
22 | end |
||
23 | end |
||
25 |