Class: AgileNotifier::CI::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/agile_notifier/ci.rb

Direct Known Subclasses

Jenkins::Job

Defined Under Namespace

Classes: Build

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url, build_number = nil) ⇒ Job

Returns a new instance of Job.



23
24
25
26
27
# File 'lib/agile_notifier/ci.rb', line 23

def initialize(name, url, build_number = nil)
  @name = name
  @url = url
  @current_build = build_number.nil? ? get_last_build : get_specific_build(build_number.to_i)
end

Instance Attribute Details

#current_buildObject (readonly)

Returns the value of attribute current_build.



21
22
23
# File 'lib/agile_notifier/ci.rb', line 21

def current_build
  @current_build
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/agile_notifier/ci.rb', line 20

def name
  @name
end

#urlObject

Returns the value of attribute url.



20
21
22
# File 'lib/agile_notifier/ci.rb', line 20

def url
  @url
end

Instance Method Details

#get_last_buildObject

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/agile_notifier/ci.rb', line 33

def get_last_build
  raise(NotImplementedError, "Abstract method [#{__method__}] is called, please implement", caller)
end

#get_specific_build(build_number) ⇒ Object

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/agile_notifier/ci.rb', line 29

def get_specific_build(build_number)
  raise(NotImplementedError, "Abstract method [#{__method__}] is called, please implement", caller)
end