Class: Faith::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/faith/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContext

Returns a new instance of Context.



3
4
5
6
7
# File 'lib/faith/context.rb', line 3

def initialize
  @mixin_instances = []
  @tasks_executed = []
  @output = Output.new
end

Instance Attribute Details

#mixin_instancesObject

Returns the value of attribute mixin_instances.



9
10
11
# File 'lib/faith/context.rb', line 9

def mixin_instances
  @mixin_instances
end

#outputObject

Returns the value of attribute output.



9
10
11
# File 'lib/faith/context.rb', line 9

def output
  @output
end

#tasks_executedObject

Returns the value of attribute tasks_executed.



9
10
11
# File 'lib/faith/context.rb', line 9

def tasks_executed
  @tasks_executed
end

Instance Method Details

#mixinsObject



15
16
17
# File 'lib/faith/context.rb', line 15

def mixins
  mixin_instances.to_h { |x| [x.mixin.name, x] }
end

#ran?(task) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/faith/context.rb', line 11

def ran?(task)
  tasks_executed.include?(task)
end