Class: Fdbq::Plugin
Constant Summary collapse
- DEFAULT_PARAM_KEY =
:feedback
Instance Attribute Summary collapse
-
#config_file_path ⇒ Object
Returns the value of attribute config_file_path.
-
#controller_extensions ⇒ Object
Returns the value of attribute controller_extensions.
-
#model_extensions ⇒ Object
Returns the value of attribute model_extensions.
-
#param_key ⇒ Object
Returns the value of attribute param_key.
Instance Method Summary collapse
- #build_param_key(question_name) ⇒ Object
- #config ⇒ Object
- #questions ⇒ Object
- #reset! ⇒ Object
- #settings ⇒ Object
Instance Attribute Details
#config_file_path ⇒ Object
Returns the value of attribute config_file_path.
10 11 12 |
# File 'lib/fdbq/plugin.rb', line 10 def config_file_path @config_file_path end |
#controller_extensions ⇒ Object
Returns the value of attribute controller_extensions.
12 13 14 |
# File 'lib/fdbq/plugin.rb', line 12 def controller_extensions @controller_extensions end |
#model_extensions ⇒ Object
Returns the value of attribute model_extensions.
13 14 15 |
# File 'lib/fdbq/plugin.rb', line 13 def model_extensions @model_extensions end |
#param_key ⇒ Object
Returns the value of attribute param_key.
11 12 13 |
# File 'lib/fdbq/plugin.rb', line 11 def param_key @param_key end |
Instance Method Details
#build_param_key(question_name) ⇒ Object
40 41 42 |
# File 'lib/fdbq/plugin.rb', line 40 def build_param_key(question_name) "#{param_key}[#{question_name}]" end |
#config ⇒ Object
36 37 38 |
# File 'lib/fdbq/plugin.rb', line 36 def config YAML.load_file(config_file_path).to_h end |
#questions ⇒ Object
24 25 26 |
# File 'lib/fdbq/plugin.rb', line 24 def questions config.dig('questions').to_a.map(&Question.method(:new)) end |
#reset! ⇒ Object
19 20 21 22 |
# File 'lib/fdbq/plugin.rb', line 19 def reset! self.param_key = DEFAULT_PARAM_KEY self.config_file_path = nil end |