Class: CfScript::Command::Line
- Inherits:
-
Object
- Object
- CfScript::Command::Line
- Defined in:
- lib/cf_script/command/line.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#bin ⇒ Object
readonly
Returns the value of attribute bin.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #hide_sensitive ⇒ Object
-
#initialize(env, bin, type, name, args = []) ⇒ Line
constructor
A new instance of Line.
- #line ⇒ Object (also: #to_s)
Constructor Details
#initialize(env, bin, type, name, args = []) ⇒ Line
Returns a new instance of Line.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cf_script/command/line.rb', line 12 def initialize(env, bin, type, name, args = []) @env = env @bin = bin @type = type @name = name @options = args.last.is_a?(Hash) ? args.pop : {} @flags = .delete(:flags) || [] @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
8 9 10 |
# File 'lib/cf_script/command/line.rb', line 8 def args @args end |
#bin ⇒ Object (readonly)
Returns the value of attribute bin.
5 6 7 |
# File 'lib/cf_script/command/line.rb', line 5 def bin @bin end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/cf_script/command/line.rb', line 4 def env @env end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
10 11 12 |
# File 'lib/cf_script/command/line.rb', line 10 def flags @flags end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/cf_script/command/line.rb', line 7 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/cf_script/command/line.rb', line 9 def @options end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/cf_script/command/line.rb', line 6 def type @type end |
Instance Method Details
#hide_sensitive ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cf_script/command/line.rb', line 28 def hide_sensitive case name when :auth hide_parts(-1, 'PASSWORD HIDDEN') when :login hide_option('-p', 'PASSWORD HIDDEN') else line end end |
#line ⇒ Object Also known as: to_s
23 24 25 |
# File 'lib/cf_script/command/line.rb', line 23 def line @line ||= format end |