Class: Sambot::Slack::WorkItem
- Inherits:
-
Object
- Object
- Sambot::Slack::WorkItem
- Defined in:
- lib/sambot/slack/work_item.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#product_tag ⇒ Object
readonly
Returns the value of attribute product_tag.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Class Method Summary collapse
Instance Method Summary collapse
- #assigned_on ⇒ Object
- #assignee ⇒ Object
- #closed_by ⇒ Object
- #column ⇒ Object
- #column_order ⇒ Object
- #column_rank ⇒ Object
- #created_by_id ⇒ Object
- #created_date ⇒ Object
- #deleted? ⇒ Boolean
- #description ⇒ Object
- #epic ⇒ Object
- #help_status ⇒ Object
- #id_and_subject ⇒ Object
-
#initialize(s_object) ⇒ WorkItem
constructor
A new instance of WorkItem.
- #last_activity_date ⇒ Object
- #owner_id ⇒ Object
- #priority ⇒ Object
- #product_owner ⇒ Object
- #product_tag_name ⇒ Object
- #qa_engineer ⇒ Object
- #record_type_id ⇒ Object
- #resolution ⇒ Object
- #story_points ⇒ Object
Constructor Details
#initialize(s_object) ⇒ WorkItem
Returns a new instance of WorkItem.
7 8 9 |
# File 'lib/sambot/slack/work_item.rb', line 7 def initialize(s_object) @s_object = s_object end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/sambot/slack/work_item.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/sambot/slack/work_item.rb', line 5 def name @name end |
#product_tag ⇒ Object (readonly)
Returns the value of attribute product_tag.
5 6 7 |
# File 'lib/sambot/slack/work_item.rb', line 5 def product_tag @product_tag end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/sambot/slack/work_item.rb', line 5 def status @status end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
5 6 7 |
# File 'lib/sambot/slack/work_item.rb', line 5 def subject @subject end |
Class Method Details
.find_by_product_tag(client, val) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/sambot/slack/work_item.rb', line 68 def self.find_by_product_tag(client, val) product_tag = ProductTag.find(client, val) query = "SELECT Id, Name, Status__c, Product_Tag__c, Subject__c, Priority__c, Product_Owner__c, QA_Engineer__c, Help_Status__c, Assignee__r.Name, Assigned_On__c, LastActivityDate, CreatedById, CreatedDate, RecordTypeId, OwnerId, IsDeleted, Description__c, Story_Points__c, Closed_By__c, Product_Tag_Name__c, Epic__c, Resolution__c, Column_Rank__c, Column__r.Name, WorkId_and_Subject__c FROM ADM_Work__c \ WHERE Product_Tag__c = '#{product_tag.id}' AND (Status__c = 'New' OR Status__c = 'In Progress')" results = client.query(query) results.map {|x| WorkItem.new(x) }.sort_by {|x| [x.column_order, x.column_rank]} end |
Instance Method Details
#assigned_on ⇒ Object
31 |
# File 'lib/sambot/slack/work_item.rb', line 31 def assigned_on; @s_object.Assigned_On__c; end |
#assignee ⇒ Object
29 |
# File 'lib/sambot/slack/work_item.rb', line 29 def assignee; @s_object.Assignee__r.Name; end |
#closed_by ⇒ Object
49 |
# File 'lib/sambot/slack/work_item.rb', line 49 def closed_by; @s_object.Closed_By__c; end |
#column ⇒ Object
59 |
# File 'lib/sambot/slack/work_item.rb', line 59 def column; @s_object.Column__r ? @s_object.Column__r.Name : ''; end |
#column_order ⇒ Object
61 62 63 64 |
# File 'lib/sambot/slack/work_item.rb', line 61 def column_order puts Formatter::COLUMNS[column.to_sym] ? Formatter::COLUMNS[column.to_sym][:order] : 100 column && Formatter::COLUMNS[column.to_sym] ? Formatter::COLUMNS[column.to_sym][:order] : 100 end |
#column_rank ⇒ Object
57 |
# File 'lib/sambot/slack/work_item.rb', line 57 def column_rank; @s_object.Column_Rank__c || 0; end |
#created_by_id ⇒ Object
35 |
# File 'lib/sambot/slack/work_item.rb', line 35 def created_by_id; @s_object.CreatedById; end |
#created_date ⇒ Object
37 |
# File 'lib/sambot/slack/work_item.rb', line 37 def created_date; @s_object.CreatedDate; end |
#deleted? ⇒ Boolean
43 |
# File 'lib/sambot/slack/work_item.rb', line 43 def deleted?; @s_object.IsDeleted; end |
#description ⇒ Object
45 |
# File 'lib/sambot/slack/work_item.rb', line 45 def description; @s_object.Product_Owner__c; end |
#epic ⇒ Object
53 |
# File 'lib/sambot/slack/work_item.rb', line 53 def epic; @s_object.Epic__c; end |
#help_status ⇒ Object
27 |
# File 'lib/sambot/slack/work_item.rb', line 27 def help_status; @s_object.Help_Status__c; end |
#id_and_subject ⇒ Object
66 |
# File 'lib/sambot/slack/work_item.rb', line 66 def id_and_subject; @s_object.WorkId_and_Subject__c; end |
#last_activity_date ⇒ Object
33 |
# File 'lib/sambot/slack/work_item.rb', line 33 def last_activity_date; @s_object.LastActivityDate; end |
#owner_id ⇒ Object
41 |
# File 'lib/sambot/slack/work_item.rb', line 41 def owner_id; @s_object.OwnerId; end |
#priority ⇒ Object
21 |
# File 'lib/sambot/slack/work_item.rb', line 21 def priority; @s_object.Priority__c; end |
#product_owner ⇒ Object
23 |
# File 'lib/sambot/slack/work_item.rb', line 23 def product_owner; @s_object.Product_Owner__c; end |
#product_tag_name ⇒ Object
51 |
# File 'lib/sambot/slack/work_item.rb', line 51 def product_tag_name; @s_object.Product_Tag_Name__c; end |
#qa_engineer ⇒ Object
25 |
# File 'lib/sambot/slack/work_item.rb', line 25 def qa_engineer; @s_object.QA_Engineer__c; end |
#record_type_id ⇒ Object
39 |
# File 'lib/sambot/slack/work_item.rb', line 39 def record_type_id; @s_object.RecordTypeId; end |
#resolution ⇒ Object
55 |
# File 'lib/sambot/slack/work_item.rb', line 55 def resolution; @s_object.Resolution__c; end |
#story_points ⇒ Object
47 |
# File 'lib/sambot/slack/work_item.rb', line 47 def story_points; @s_object.QA_Engineer__c; end |