Class: KafoWizards::Entries::SelectorEntry
- Inherits:
-
StringEntry
- Object
- AbstractEntry
- StringEntry
- KafoWizards::Entries::SelectorEntry
- Defined in:
- lib/kafo_wizards/entries/selector.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Attributes inherited from AbstractEntry
#default_value, #description, #label, #name, #parent, #post_hook, #pre_hook, #validators, #value
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ SelectorEntry
constructor
A new instance of SelectorEntry.
- #validate(value) ⇒ Object
Methods inherited from AbstractEntry
#call_post_hook, #call_pre_hook, descendants, #display_type, inherited, #required?, #update
Constructor Details
#initialize(name, options = {}) ⇒ SelectorEntry
Returns a new instance of SelectorEntry.
6 7 8 9 |
# File 'lib/kafo_wizards/entries/selector.rb', line 6 def initialize(name, ={}) super(name, ) @options = .fetch(:options, {}) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/kafo_wizards/entries/selector.rb', line 4 def @options end |
Class Method Details
.entry_type ⇒ Object
16 17 18 |
# File 'lib/kafo_wizards/entries/selector.rb', line 16 def self.entry_type :selector end |
Instance Method Details
#validate(value) ⇒ Object
11 12 13 14 |
# File 'lib/kafo_wizards/entries/selector.rb', line 11 def validate(value) raise KafoWizards::ValidationError.new("#{value} is not a valid option") unless .include?(value) value end |