Class: Changelog::Item
- Inherits:
-
Object
- Object
- Changelog::Item
- Defined in:
- lib/changelog.rb
Instance Method Summary collapse
- #author ⇒ Object
- #built? ⇒ Boolean
- #complete? ⇒ Boolean
- #date ⇒ Object
- #environments ⇒ Object
- #id ⇒ Object
-
#initialize(title, id, description, sha, date, source, type = nil, status = nil, author = nil, environments = nil) ⇒ Item
constructor
A new instance of Item.
- #inspect ⇒ Object
- #released? ⇒ Boolean
- #sha ⇒ Object
- #source ⇒ Object
- #sprintly? ⇒ Boolean
- #status ⇒ Object
- #title ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(title, id, description, sha, date, source, type = nil, status = nil, author = nil, environments = nil) ⇒ Item
Returns a new instance of Item.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/changelog.rb', line 103 def initialize(title, id, description, sha, date, source, type=nil, status=nil, =nil, environments=nil) type ||="NA" status ||="UNKNOWN" ||="UNKNOWN" environments ||= [] @title = title.delete("\n") @description = description @sha = sha @date = date @id = id @source = source @type = type @status = status @author = @environments = environments end |
Instance Method Details
#author ⇒ Object
136 137 138 |
# File 'lib/changelog.rb', line 136 def return @author end |
#built? ⇒ Boolean
168 169 170 |
# File 'lib/changelog.rb', line 168 def built? return self.environments.join.scan(/#(\d+)/).any? unless self.environments.nil? end |
#complete? ⇒ Boolean
164 165 166 |
# File 'lib/changelog.rb', line 164 def complete? return %w(COMPLETED ACCEPTED).include?(self.status) end |
#date ⇒ Object
128 129 130 |
# File 'lib/changelog.rb', line 128 def date return @date end |
#environments ⇒ Object
140 141 142 |
# File 'lib/changelog.rb', line 140 def environments return @environments.any? ? @environments : nil end |
#id ⇒ Object
148 149 150 |
# File 'lib/changelog.rb', line 148 def id return @id end |
#inspect ⇒ Object
120 121 122 |
# File 'lib/changelog.rb', line 120 def inspect "<#{@source} #{@type.upcase} ##{@id} : #{self.status} : #{@title}>" end |
#released? ⇒ Boolean
172 173 174 |
# File 'lib/changelog.rb', line 172 def released? return self.environments.join.scan(/v(\d+)/).any? unless self.environments.nil? end |
#sha ⇒ Object
144 145 146 |
# File 'lib/changelog.rb', line 144 def sha return @sha end |
#source ⇒ Object
156 157 158 |
# File 'lib/changelog.rb', line 156 def source return @source end |
#sprintly? ⇒ Boolean
160 161 162 |
# File 'lib/changelog.rb', line 160 def sprintly? return self.source.upcase == "SPRINT.LY" end |
#status ⇒ Object
152 153 154 |
# File 'lib/changelog.rb', line 152 def status return @status.nil? ? "NA" : @status.upcase end |
#title ⇒ Object
124 125 126 |
# File 'lib/changelog.rb', line 124 def title return @title end |
#type ⇒ Object
132 133 134 |
# File 'lib/changelog.rb', line 132 def type return @type end |