Class: Runciter::App

Inherits:
Object
  • Object
show all
Defined in:
lib/runciter/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, endpoint, opts = {}) ⇒ App

Returns a new instance of App.



6
7
8
9
10
11
12
13
14
# File 'lib/runciter/app.rb', line 6

def initialize(name, endpoint, opts = {})
  @name = name
  @endpoint = URI(endpoint)
  @opts = opts

  @api = Jimson::Client.new(endpoint)

  register!
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



3
4
5
# File 'lib/runciter/app.rb', line 3

def api
  @api
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/runciter/app.rb', line 3

def id
  @id
end

Instance Method Details

#task(name, opts = {}, &block) ⇒ Object



16
17
18
19
# File 'lib/runciter/app.rb', line 16

def task(name, opts = {}, &block)
  task = Task.new(self, name, opts)
  task.run!(&block)
end