lib/cliutils/prefs/pref_actions/pref_action.rb in cliutils-1.4.2 vs lib/cliutils/prefs/pref_actions/pref_action.rb in cliutils-2.0.0
- old
+ new
@@ -1,23 +1,32 @@
module CLIUtils
# The generic base class for a Pref
- # action.
+ # Action.
class PrefAction
include Messaging
+ # Holds the parameters that apply to
+ # this Action.
+ # @!attribute parameters
+ # @return [Hash]
+ attr_accessor :parameters
+
# Holds a reference to the pref that
- # is implementing this action.
+ # is implementing this Action.
+ # @!attribute pref
# @return [Pref]
attr_accessor :pref
- # Runs the plugin. Note that the
- # method implemented here shows
- # an error (indicating that it
- # needs to be implemented in a
- # subclass).
+ # Runs the Action. Note that the
+ # method implemented here will throw
+ # an exception by default, meaning that
+ # the user's subclass *needs* to
+ # implement it.
# @parameter [Hash] parameters
+ # @raise [StandardError] if the subclass
+ # doesn't implement this method.
# @return [void]
- def run(parameters = {})
- messenger.error("`run` method not implemented on caller: #{ self.class }")
+ def run
+ fail "`run` method not implemented on caller: #{ self.class }"
end
end
end
\ No newline at end of file