module Verbalize::Action
Constants
- THROWN_SYMBOL
Public Class Methods
included(target)
click to toggle source
# File lib/verbalize/action.rb, line 18 def self.included(target) target.extend ClassMethods end
Public Instance Methods
action_inputs()
click to toggle source
# File lib/verbalize/action.rb, line 14 def action_inputs self.class.inputs.map { |i| [i, self.send(i)] }.to_h end
fail!(failure_value = nil)
click to toggle source
# File lib/verbalize/action.rb, line 10 def fail!(failure_value = nil) throw(THROWN_SYMBOL, failure_value) end
Private Instance Methods
__setup(key, value)
click to toggle source
# File lib/verbalize/action.rb, line 24 def __setup(key, value) is_valid = self.class.input_is_valid?(key, value) local_error = self.class.pop_local_error fail!(local_error) if !is_valid && local_error fail! "Input '#{key}' failed validation!" unless is_valid instance_variable_set(:"@#{key}", value) end