Class: Anoubis::Output::Autocomplete
- Defined in:
- app/controllers/anoubis/output/autocomplete.rb
Overview
Output subclass that represents data for edit(new) action
Instance Attribute Summary collapse
-
#values ⇒ Hash
The hash of defined fields.
Attributes inherited from Basic
#messages, #result, #tab, #title
Instance Method Summary collapse
-
#initialize ⇒ Autocomplete
constructor
Initializes menu output data.
-
#to_h ⇒ Hash
Generates hash representation of output class.
Methods inherited from Basic
#hash_to_json, #message, #options_to_json
Constructor Details
#initialize ⇒ Autocomplete
Initializes menu output data. Generates default values.
12 13 14 15 |
# File 'app/controllers/anoubis/output/autocomplete.rb', line 12 def initialize super self.values = [] end |
Instance Attribute Details
#values ⇒ Hash
Returns the hash of defined fields.
8 |
# File 'app/controllers/anoubis/output/autocomplete.rb', line 8 class_attribute :values, default: {} |
Instance Method Details
#to_h ⇒ Hash
Generates hash representation of output class
20 21 22 23 24 25 26 27 |
# File 'app/controllers/anoubis/output/autocomplete.rb', line 20 def to_h result = super.to_h return result if self.result != 0 result.merge!({ values: self.values, }) result end |