Class: Cl::Ctx
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
- #abort(error, *strs) ⇒ Object
- #abort? ⇒ Boolean
-
#initialize(name, opts = {}) ⇒ Ctx
constructor
A new instance of Ctx.
- #test? ⇒ Boolean
- #ui ⇒ Object
Constructor Details
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
12 13 14 |
# File 'lib/cl/ctx.rb', line 12 def config @config end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/cl/ctx.rb', line 12 def name @name end |
#opts ⇒ Object
Returns the value of attribute opts.
12 13 14 |
# File 'lib/cl/ctx.rb', line 12 def opts @opts end |
Instance Method Details
#abort(error, *strs) ⇒ Object
24 25 26 |
# File 'lib/cl/ctx.rb', line 24 def abort(error, *strs) abort? ? ui.abort(error, *strs) : raise(error) end |
#abort? ⇒ Boolean
28 29 30 |
# File 'lib/cl/ctx.rb', line 28 def abort? !opts[:abort].is_a?(FalseClass) end |
#test? ⇒ Boolean
32 33 34 |
# File 'lib/cl/ctx.rb', line 32 def test? ENV['ENV'] == 'test' end |