Class: Builtin
- Inherits:
-
Object
- Object
- Builtin
- Defined in:
- lib/builtin.rb
Direct Known Subclasses
Builtins::Background, Builtins::BackgroundLog, Builtins::Common::UpDown, Builtins::Countdown, Builtins::Env, Builtins::Envdiff, Builtins::Exec, Builtins::Help, Builtins::Init, Builtins::Version
Defined Under Namespace
Classes: ArgumentError
Constant Summary collapse
- BUILTIN_DIR =
"builtins"
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args, config) ⇒ Builtin
constructor
A new instance of Builtin.
- #run ⇒ Object
Constructor Details
#initialize(args, config) ⇒ Builtin
Returns a new instance of Builtin.
43 44 45 46 |
# File 'lib/builtin.rb', line 43 def initialize(args, config) @args = args @config = config end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
6 7 8 |
# File 'lib/builtin.rb', line 6 def args @args end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/builtin.rb', line 6 def config @config end |
Class Method Details
.class_for(name:) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/builtin.rb', line 15 def class_for(name:) file = file_for(name: name) unless File.exist?(file) require 'require_all' require_rel "builtins" end get_const(name: builtin_class_name_for(name: name)) end |
.description ⇒ Object
11 12 13 |
# File 'lib/builtin.rb', line 11 def description "no description" end |
Instance Method Details
#run ⇒ Object
48 49 50 |
# File 'lib/builtin.rb', line 48 def run raise NotImplementedError end |