Class: Job
- Inherits:
-
Object
- Object
- Job
- Defined in:
- lib/yamlease.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#yaml ⇒ Object
Returns the value of attribute yaml.
Instance Method Summary collapse
-
#initialize(name, url) ⇒ Job
constructor
A new instance of Job.
- #name ⇒ Object
- #tasks ⇒ Object
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
#url ⇒ Object (readonly)
Returns the value of attribute url.
28 29 30 |
# File 'lib/yamlease.rb', line 28 def url @url end |
#yaml ⇒ Object
Returns the value of attribute yaml.
28 29 30 |
# File 'lib/yamlease.rb', line 28 def yaml @yaml end |
Instance Method Details
#name ⇒ Object
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 |
#tasks ⇒ Object
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 |