Class: Dev::TargetProcess::UserStoryHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/firespring_dev_commands/target_process/user_story_history.rb

Overview

Class containing user story information

Constant Summary collapse

RESOURCE_TYPE =

The resource type for the api endpoint

'UserStoryHistory'.freeze
PATH =

The api path for user story requests

'/UserStoryHistories'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ UserStoryHistory

Returns a new instance of UserStoryHistory.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 14

def initialize(data)
  @data = data
  @id = data['Id']
  @source_entity_id = data['SourceEntityId']
  @type = data['ResourceType']
  @name = data['Name']
  @description = data['Description']
  @state = data['EntityState']['Name'] if data['EntityState']
  @project = Project.new(data['Project']) if data['Project']
  @owner = User.new(data['Owner']) if data['Owner']
  @creator = User.new(data['Creator']) if data['Creator']
  @release = Release.new(data['Release']) if data['Release']
  @team = Team.new(data['Team']) if data['Team']
  @start_date = parse_time(data['StartDate'])
  @end_date = parse_time(data['EndDate'])
  @create_date = parse_time(data['CreateDate'])
  @modify_date = parse_time(data['ModifyDate'])
  @tags = data['Tags']
  @effort = data['Effort']
  @time_spent = data['TimeSpent']
  @last_state_change_date = parse_time(data['LastStateChangeDate'])
end

Instance Attribute Details

#create_dateObject

Returns the value of attribute create_date.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def create_date
  @create_date
end

#creatorObject

Returns the value of attribute creator.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def creator
  @creator
end

#dataObject

Returns the value of attribute data.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def data
  @data
end

#descriptionObject

Returns the value of attribute description.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def description
  @description
end

#effortObject

Returns the value of attribute effort.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def effort
  @effort
end

#end_dateObject

Returns the value of attribute end_date.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def end_date
  @end_date
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def id
  @id
end

#last_state_change_dateObject

Returns the value of attribute last_state_change_date.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def last_state_change_date
  @last_state_change_date
end

#modify_dateObject

Returns the value of attribute modify_date.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def modify_date
  @modify_date
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def name
  @name
end

#ownerObject

Returns the value of attribute owner.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def owner
  @owner
end

#priorityObject

Returns the value of attribute priority.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def priority
  @priority
end

#projectObject

Returns the value of attribute project.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def project
  @project
end

#releaseObject

Returns the value of attribute release.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def release
  @release
end

#source_entity_idObject

Returns the value of attribute source_entity_id.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def source_entity_id
  @source_entity_id
end

#start_dateObject

Returns the value of attribute start_date.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def start_date
  @start_date
end

#stateObject

Returns the value of attribute state.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def state
  @state
end

#tagsObject

Returns the value of attribute tags.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def tags
  @tags
end

#teamObject

Returns the value of attribute team.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def team
  @team
end

#time_spentObject

Returns the value of attribute time_spent.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def time_spent
  @time_spent
end

#typeObject

Returns the value of attribute type.



11
12
13
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 11

def type
  @type
end

Instance Method Details

#parse_time(string) ⇒ Object

Parse the dot net time representation into something that ruby can use



38
39
40
41
42
# File 'lib/firespring_dev_commands/target_process/user_story_history.rb', line 38

def parse_time(string)
  return nil unless string && !string.empty?

  ::Time.at(string.slice(6, 10).to_i)
end