Class: Grably::Module::ModuleCall

Inherits:
Object
  • Object
show all
Defined in:
lib/grably/core/module.rb

Overview

Reference to external module task call

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, task, profile = c.profile) ⇒ ModuleCall

Initializes module reference with load path and profile

Parameters:

  • path (String)

    absolute path to referencing module



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

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/grably/core/module.rb', line 10

def path
  @path
end

#profileObject (readonly)

Returns the value of attribute profile.



10
11
12
# File 'lib/grably/core/module.rb', line 10

def profile
  @profile
end

#taskObject (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_printObject



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

Parameters:

  • profile (*String)

    profile names



21
22
23
24
# File 'lib/grably/core/module.rb', line 21

def with_profile(*profile)
  @profile = profile
  self
end