Class: Avmtrf1::Jira::Entities::Issue

Inherits:
RestProvider::Entity show all
Defined in:
lib/avmtrf1/jira/entities/issue.rb

Constant Summary collapse

CATEGORY_CLOSED_STATUSES =
%w[PendĂȘncias ConcluĂ­do].freeze
CATEGORY_OPEN_STATUSES =
['Em andamento'].freeze

Instance Attribute Summary

Attributes inherited from RestProvider::Entity

#data, #instance

Instance Method Summary collapse

Methods inherited from RestProvider::Entity

#initialize

Constructor Details

This class inherits a constructor from Avmtrf1::RestProvider::Entity

Instance Method Details

#closed?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
25
26
# File 'lib/avmtrf1/jira/entities/issue.rb', line 20

def closed?
  return true if CATEGORY_CLOSED_STATUSES.include?(status_category_name)
  return false if CATEGORY_OPEN_STATUSES.include?(status_category_name)

  raise "Unknown category status \"#{status_category_name}\" " \
        "(Status: \"#{status_name}\")"
end

#status_category_nameObject



16
17
18
# File 'lib/avmtrf1/jira/entities/issue.rb', line 16

def status_category_name
  data.fetch('fields').fetch('status').fetch('statusCategory').fetch('name')
end

#status_nameObject



12
13
14
# File 'lib/avmtrf1/jira/entities/issue.rb', line 12

def status_name
  data.fetch('fields').fetch('status').fetch('name')
end