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
-
#data ⇒ Object
Returns the value of attribute data.
-
#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
Returns a new instance of TeamAssignment.
13 14 15 16 17 18 19 20 21 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 13 def initialize(data) @data = 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
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 11 def data @data end |
#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
31 32 33 34 35 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 31 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
24 25 26 27 28 |
# File 'lib/firespring_dev_commands/target_process/team_assignment.rb', line 24 def parse_time(string) return nil unless string && !string.empty? ::Time.at(string.slice(6, 10).to_i) end |