Class: Rap::Declarations::Context

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app = Tap::App.instance) ⇒ Context

Returns a new instance of Context.



22
23
24
25
26
27
# File 'lib/rap/declarations/context.rb', line 22

def initialize(app=Tap::App.instance)
  app.env ||= Tap::Env.new
  @app = app
  @namespace = ""
  @desc = nil
end

Instance Attribute Details

#appObject

The declarations App



13
14
15
# File 'lib/rap/declarations/context.rb', line 13

def app
  @app
end

#descObject

Tracks the current description, which will be used to document the next task declaration.



20
21
22
# File 'lib/rap/declarations/context.rb', line 20

def desc
  @desc
end

#namespaceObject

The base constant for all task declarations, prepended to the task name.



16
17
18
# File 'lib/rap/declarations/context.rb', line 16

def namespace
  @namespace
end

Class Method Details

.instanceObject



7
8
9
# File 'lib/rap/declarations/context.rb', line 7

def instance
  @instance ||= new
end