Class: DevOops::ScriptsLoader::ScriptConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/dev_oops/scripts_loader.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



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

def args
  @args
end

#descObject

Returns the value of attribute desc

Returns:

  • (Object)

    the current value of desc



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

def desc
  @desc
end

#dirObject

Returns the value of attribute dir

Returns:

  • (Object)

    the current value of dir



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

def dir
  @dir
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



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

def name
  @name
end

#script_locationObject

Returns the value of attribute script_location

Returns:

  • (Object)

    the current value of script_location



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

def script_location
  @script_location
end

#usageObject

Returns the value of attribute usage

Returns:

  • (Object)

    the current value of usage



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

def usage
  @usage
end

Class Method Details

.create(script_name, script_location, json_config, dir) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/dev_oops/scripts_loader.rb', line 8

def self.create(script_name, script_location, json_config, dir)
  new(
    script_name,
    json_config['desc'] || 'Missing description',
    "#{script_name} #{json_config['usage'] || ''}",
    script_location,
    json_config['args'],
    dir
  )
end