Class: Bashly::Models::Flag
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#help, #initialize, #method_missing, #optional, #respond_to?, #summary
Methods included from Renderable
Constructor Details
This class inherits a constructor from Bashly::Models::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Bashly::Models::Base
Instance Method Details
#aliases ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/bashly/models/flag.rb', line 4 def aliases if long and short [long, short] elsif long [long] else [short] end end |
#name ⇒ Object
14 15 16 |
# File 'lib/bashly/models/flag.rb', line 14 def name long || short end |
#usage_string(extended: false) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/bashly/models/flag.rb', line 18 def usage_string(extended: false) result = [aliases.join(", ")] result << arg.upcase if arg result << strings[:required] if required and extended result.join " " end |