Class: Dev::TargetProcess::TeamAssignment
- Defined in:
- lib/firespring_dev_commands/target_process/team_assignment.rb
Overview
Class containing project information
Constant Summary collapse
- RESOURCE_TYPE =
The resource type for the api endpoint
'TeamAssignment'.freeze
- PATH =
The api path for team assignment requests
'/TeamAssignments'.freeze
Instance Attribute Summary collapse
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#story ⇒ Object
Returns the value of attribute story.
-
#team ⇒ Object
Returns the value of attribute team.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#cycle_time ⇒ Object
Calculate the cycle time as the amount of time the story was open.
-
#initialize(data) ⇒ TeamAssignment
constructor
A new instance of TeamAssignment.
-
#parse_time(string) ⇒ Object
Parse the dot net time representation into something that ruby can use.
Constructor Details
#initialize(data) ⇒ TeamAssignment
13 14 15 16 17 18 19 20 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 13 def initialize(data) @id = data['Id'] @type = data['ResourceType'] @start_date = parse_time(data['StartDate']) @end_date = parse_time(data['EndDate']) @team = Team.new(data['Team']) if data['Team'] @story = UserStory.new(data['Assignable']) if data['Assignable'] end |
Instance Attribute Details
#end_date ⇒ Object
Returns the value of attribute end_date.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 11 def end_date @end_date end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 11 def id @id end |
#start_date ⇒ Object
Returns the value of attribute start_date.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 11 def start_date @start_date end |
#story ⇒ Object
Returns the value of attribute story.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 11 def story @story end |
#team ⇒ Object
Returns the value of attribute team.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 11 def team @team end |
#type ⇒ Object
Returns the value of attribute type.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 11 def type @type end |
Instance Method Details
#cycle_time ⇒ Object
Calculate the cycle time as the amount of time the story was open
30 31 32 33 34 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 30 def cycle_time return 1.0 unless start_date && end_date (end_date - start_date).to_f / (60 * 60 * 24) end |
#parse_time(string) ⇒ Object
Parse the dot net time representation into something that ruby can use
23 24 25 26 27 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 23 def parse_time(string) return nil unless string && !string.empty? Time.at(string.slice(6, 10).to_i) end |