Class: Job

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url) ⇒ Job

Returns a new instance of Job.



31
32
33
34
# File 'lib/yamlease.rb', line 31

def initialize(name, url)
  @name = name
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



28
29
30
# File 'lib/yamlease.rb', line 28

def url
  @url
end

#yamlObject

Returns the value of attribute yaml.



28
29
30
# File 'lib/yamlease.rb', line 28

def yaml
  @yaml
end

Instance Method Details

#nameObject



42
43
44
45
46
47
48
49
# File 'lib/yamlease.rb', line 42

def name
  parts = @name.split(" ")
  parts.map do |part|
    first_character = part[0]
    part[0] = first_character.upcase
    part
  end.join("")
end

#tasksObject



36
37
38
39
40
# File 'lib/yamlease.rb', line 36

def tasks
  self.yaml["workflowTasks"].collect do |task|
    Task.new(yaml = task)
  end
end