Class: Issue

Inherits:
Object
  • Object
show all
Defined in:
lib/sleeping-wolf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIssue

Returns a new instance of Issue.



18
19
20
21
# File 'lib/sleeping-wolf.rb', line 18

def initialize
	@comments = []
	@labels = []
end

Instance Attribute Details

#commentsObject

arrays



16
17
18
# File 'lib/sleeping-wolf.rb', line 16

def comments
  @comments
end

#date_openedObject

Returns the value of attribute date_opened.



15
16
17
# File 'lib/sleeping-wolf.rb', line 15

def date_opened
  @date_opened
end

#idObject

from octopi attr_accessor :repository, :user, :updated_at, :votes, :number, :title attr_accessor :body, :closed_at, :labels, :state, :created_at



14
15
16
# File 'lib/sleeping-wolf.rb', line 14

def id
  @id
end

#labelsObject

arrays



16
17
18
# File 'lib/sleeping-wolf.rb', line 16

def labels
  @labels
end

#stateObject

Returns the value of attribute state.



15
16
17
# File 'lib/sleeping-wolf.rb', line 15

def state
  @state
end

#titleObject

Returns the value of attribute title.



15
16
17
# File 'lib/sleeping-wolf.rb', line 15

def title
  @title
end

Instance Method Details

#to_sObject



23
24
25
26
27
28
29
# File 'lib/sleeping-wolf.rb', line 23

def to_s
	s = "#{@title} (#{@state}) -- #{@date_opened.strftime '%Y-%m-%d'}"
	s << "\n\tlabels: #{@labels.join ', '}"
	@comments.each {|comment| s << "\n\t#{comment}"}
	
	return s
end