method
from_superclass
ruby latest stable - Class:
Bundler::Thor::Base::ClassMethods
Method not available on this version
This method is only available on newer versions. The first available version (v2_6_3) is shown here.
from_superclass(method, default = nil)protected
Retrieves a value from superclass. If it reaches the baseclass, returns default.
# File lib/bundler/vendor/thor/lib/thor/base.rb, line 626
def from_superclass(method, default = nil)
if self == baseclass || !superclass.respond_to?(method, true)
default
else
value = superclass.send(method)
# Ruby implements `dup` on Object, but raises a `TypeError`
# if the method is called on immediates. As a result, we
# don't have a good way to check whether dup will succeed
# without calling it and rescuing the TypeError.
begin
value.dup
rescue TypeError
value
end
end
end Related methods
- Instance methods
- all_commands
- all_tasks
- argument
- arguments
- attr_accessor
- attr_reader
- attr_writer
- check_default_type
- check_default_type!
- check_default_type?
- check_unknown_options
- check_unknown_options!
- check_unknown_options?
- class_option
- class_options
- commands
- disable_required_check?
- group
- handle_argument_error
- handle_no_command_error
- handle_no_task_error
- namespace
- no_commands
- no_tasks
- public_command
- public_task
- remove_argument
- remove_class_option
- remove_command
- remove_task
- start
- stop_on_unknown_option?
- strict_args_position
- strict_args_position!
- strict_args_position?
- tasks
- Protected methods
-
baseclass -
basename -
build_option -
build_options -
class_options_help -
create_command -
create_task -
dispatch -
exit_on_failure? -
find_and_refresh_command -
find_and_refresh_task -
from_superclass -
inherited -
initialize_added -
is_thor_reserved_word? -
method_added -
print_options