Class: Builtin

Inherits:
Object
  • Object
show all
Defined in:
lib/builtin.rb

Defined Under Namespace

Classes: ArgumentError

Constant Summary collapse

BUILTIN_DIR =
"builtins"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#argsObject (readonly)

Returns the value of attribute args.



6
7
8
# File 'lib/builtin.rb', line 6

def args
  @args
end

#configObject (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

.descriptionObject



11
12
13
# File 'lib/builtin.rb', line 11

def description
  "no description"
end

Instance Method Details

#runObject

Raises:

  • (NotImplementedError)


48
49
50
# File 'lib/builtin.rb', line 48

def run
  raise NotImplementedError
end