Class: Jira::Auto::Tool::Performer::SprintRenamer::NextNameGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_name_of_first_renamed_sprint, name_of_first_renamed_sprint) ⇒ NextNameGenerator

Returns a new instance of NextNameGenerator.



13
14
15
16
# File 'lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb', line 13

def initialize(original_name_of_first_renamed_sprint, name_of_first_renamed_sprint)
  @original_name_of_first_renamed_sprint = Sprint::Name.parse(original_name_of_first_renamed_sprint)
  @name_of_first_renamed_sprint = Sprint::Name.parse(name_of_first_renamed_sprint)
end

Instance Attribute Details

#name_of_first_renamed_sprintObject (readonly)

Returns the value of attribute name_of_first_renamed_sprint.



11
12
13
# File 'lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb', line 11

def name_of_first_renamed_sprint
  @name_of_first_renamed_sprint
end

#original_name_of_first_renamed_sprintObject (readonly)

Returns the value of attribute original_name_of_first_renamed_sprint.



11
12
13
# File 'lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb', line 11

def original_name_of_first_renamed_sprint
  @original_name_of_first_renamed_sprint
end

Instance Method Details

#name_for(_sprint_name) ⇒ Object



18
19
20
# File 'lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb', line 18

def name_for(_sprint_name)
  next_name_in_planning_interval
end

#new_name_of_sprint_next_to_first_renamed_sprintObject



22
23
24
25
# File 'lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb', line 22

def new_name_of_sprint_next_to_first_renamed_sprint
  @new_name_of_sprint_next_to_first_renamed_sprint ||=
    name_of_first_renamed_sprint.next_in_planning_interval
end

#next_name_in_planning_intervalObject



27
28
29
30
31
32
33
34
35
# File 'lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb', line 27

def next_name_in_planning_interval
  @next_name_in_planning_interval ||= new_name_of_sprint_next_to_first_renamed_sprint

  next_name = @next_name_in_planning_interval.to_s

  @next_name_in_planning_interval = @next_name_in_planning_interval.next_in_planning_interval

  next_name
end

#pulling_sprint_into_previous_planning_interval?Boolean

Returns:

  • (Boolean)


37
38
39
40
41
# File 'lib/jira/auto/tool/performer/sprint_renamer/next_name_generator.rb', line 37

def pulling_sprint_into_previous_planning_interval?
  (name_of_first_renamed_sprint.planning_interval <=>
    original_name_of_first_renamed_sprint.planning_interval)
    .negative?
end