Module: GamesAndRpgParadise::Base::Extensions::CommandlineArguments
Overview
GamesAndRpgParadise::Base::Extensions::CommandlineArguments
Instance Method Summary
collapse
Instance Method Details
#commandline_arguments? ⇒ Boolean
Also known as:
input?
#
commandline_arguments?
#
36
37
38
|
# File 'lib/games_and_rpg_paradise/base/extensions/commandline_arguments.rb', line 36
def commandline_arguments?
@commandline_arguments
end
|
#filter_away_commandline_arguments(i = commandline_arguments?
) ⇒ Object
#
filter_away_commandline_arguments
#
43
44
45
46
47
|
# File 'lib/games_and_rpg_paradise/base/extensions/commandline_arguments.rb', line 43
def filter_away_commandline_arguments(
i = commandline_arguments?
)
return i.reject {|entry| entry.start_with? '--' }
end
|
#first_argument? ⇒ Boolean
Also known as:
first?
29
30
31
|
# File 'lib/games_and_rpg_paradise/base/extensions/commandline_arguments.rb', line 29
def first_argument?
@commandline_arguments.first
end
|
#first_non_hyphened_argument? ⇒ Boolean
#
first_non_hyphened_argument?
#
52
53
54
55
|
# File 'lib/games_and_rpg_paradise/base/extensions/commandline_arguments.rb', line 52
def first_non_hyphened_argument?
_ = commandline_arguments?
return _.reject {|entry| entry.start_with?('--') }.first
end
|
#set_commandline_arguments(i = '') ⇒ Object
#
set_commandline_arguments
#
21
22
23
24
|
# File 'lib/games_and_rpg_paradise/base/extensions/commandline_arguments.rb', line 21
def set_commandline_arguments(i = '')
i = [i].flatten.compact
@commandline_arguments = i
end
|