Class: ScrumNinja::Story

Inherits:
Struct
  • Object
show all
Defined in:
lib/scrum_ninja/story.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/scrum_ninja/story.rb', line 2

def name
  @name
end

#owner_idObject

Returns the value of attribute owner_id

Returns:

  • (Object)

    the current value of owner_id



2
3
4
# File 'lib/scrum_ninja/story.rb', line 2

def owner_id
  @owner_id
end

#story_numberObject

Returns the value of attribute story_number

Returns:

  • (Object)

    the current value of story_number



2
3
4
# File 'lib/scrum_ninja/story.rb', line 2

def story_number
  @story_number
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



2
3
4
# File 'lib/scrum_ninja/story.rb', line 2

def type
  @type
end

Instance Method Details

#branch_nameObject



15
16
17
# File 'lib/scrum_ninja/story.rb', line 15

def branch_name
  [story_number, hyphenized_name] * '-'
end

#has_owner?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/scrum_ninja/story.rb', line 11

def has_owner?
  @owner_id
end

#hyphenized_nameObject



19
20
21
22
23
# File 'lib/scrum_ninja/story.rb', line 19

def hyphenized_name
  GitWrapper.string_hyphenize(name)
rescue
  "indeterminate-branch-name-#{rand(100000000000)}"
end

#to_iObject



7
8
9
# File 'lib/scrum_ninja/story.rb', line 7

def to_i
  story_number.to_i
end

#to_sObject



3
4
5
# File 'lib/scrum_ninja/story.rb', line 3

def to_s
  '%-5s %6d: %s' % [type, story_number, name]
end