Class: KafoWizards::Entries::ButtonEntry

Inherits:
AbstractEntry show all
Defined in:
lib/kafo_wizards/entries/button.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractEntry

#default_value, #description, #label, #parent, #post_hook, #pre_hook, #validators, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractEntry

#call_post_hook, #call_pre_hook, descendants, #display_type, inherited, #required?, #update, #validate

Constructor Details

#initialize(name, options = {}) ⇒ ButtonEntry

Returns a new instance of ButtonEntry.



7
8
9
10
11
12
# File 'lib/kafo_wizards/entries/button.rb', line 7

def initialize(name, options={})
  super(name, options)
  @default = !!options.fetch(:default, true)
  @value = name
  @trigger_validation = !!options.fetch(:trigger_validation, true)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/kafo_wizards/entries/button.rb', line 5

def name
  @name
end

Class Method Details

.entry_typeObject



22
23
24
# File 'lib/kafo_wizards/entries/button.rb', line 22

def self.entry_type
  :button
end

Instance Method Details

#default?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/kafo_wizards/entries/button.rb', line 14

def default?
  @default
end

#trigger_validation?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/kafo_wizards/entries/button.rb', line 18

def trigger_validation?
  @trigger_validation
end