Class: Bashly::Script::EnvironmentVariable

Inherits:
Base
  • Object
show all
Defined in:
lib/bashly/script/environment_variable.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Attributes included from Renderable

#render_options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#help, #initialize, #method_missing, #optional, #respond_to_missing?, #summary

Methods included from Renderable

#load_user_file, #render, #strings, #user_file_exist?, #user_file_path, #view_marker

Constructor Details

This class inherits a constructor from Bashly::Script::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bashly::Script::Base

Class Method Details

.option_keysObject



5
6
7
# File 'lib/bashly/script/environment_variable.rb', line 5

def option_keys
  @option_keys ||= %i[allowed default help name required private]
end

Instance Method Details

#usage_string(extended: false) ⇒ Object



10
11
12
13
14
# File 'lib/bashly/script/environment_variable.rb', line 10

def usage_string(extended: false)
  result = [name.upcase]
  result << strings[:required] if required && extended
  result.join ' '
end