Class: Grably::Module::ModuleCall
- Inherits:
-
Object
- Object
- Grably::Module::ModuleCall
- Defined in:
- lib/grably/core/module.rb
Overview
Reference to external module task call
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(path, task, profile = c.profile) ⇒ ModuleCall
constructor
Initializes module reference with load path and profile.
- #pretty_print ⇒ Object
-
#with_profile(*profile) ⇒ Object
Updates profile settings in module ref.
Constructor Details
#initialize(path, task, profile = c.profile) ⇒ ModuleCall
Initializes module reference with load path and profile
13 14 15 16 17 |
# File 'lib/grably/core/module.rb', line 13 def initialize(path, task, profile = c.profile) @path = path @task = task @profile = profile end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/grably/core/module.rb', line 10 def path @path end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
10 11 12 |
# File 'lib/grably/core/module.rb', line 10 def profile @profile end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
10 11 12 |
# File 'lib/grably/core/module.rb', line 10 def task @task end |
Instance Method Details
#pretty_print ⇒ Object
26 27 28 29 |
# File 'lib/grably/core/module.rb', line 26 def pretty_print profiles = [*profile].flatten.join(', ') "Call Grably[#{path} / #{profiles}] #{task.to_s.white.bright}" end |
#with_profile(*profile) ⇒ Object
Updates profile settings in module ref
21 22 23 24 |
# File 'lib/grably/core/module.rb', line 21 def with_profile(*profile) @profile = profile self end |