Class: Houston::Adapters::TicketTracker::GithubAdapter::Issue
- Inherits:
-
Object
- Object
- Houston::Adapters::TicketTracker::GithubAdapter::Issue
- Defined in:
- app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb
Instance Attribute Summary collapse
-
#closed_at ⇒ Object
readonly
Returns the value of attribute closed_at.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#milestone_id ⇒ Object
readonly
Returns the value of attribute milestone_id.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#raw_attributes ⇒ Object
readonly
Returns the value of attribute raw_attributes.
-
#remote_id ⇒ Object
readonly
Returns the value of attribute remote_id.
-
#reporter_email ⇒ Object
readonly
Returns the value of attribute reporter_email.
-
#resolution ⇒ Object
readonly
Returns the value of attribute resolution.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #attributes ⇒ Object
- #close! ⇒ Object
-
#initialize(connection, attributes) ⇒ Issue
constructor
A new instance of Issue.
- #reopen! ⇒ Object
- #resolve! ⇒ Object
Constructor Details
#initialize(connection, attributes) ⇒ Issue
Returns a new instance of Issue.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 9 def initialize(connection, attributes) @connection = connection @raw_attributes = attributes # required @remote_id = attributes["id"] @number = attributes["number"] @summary = attributes["title"] @description = attributes["body"] @reporter_email = attributes["user"]["email"] @resolution = "" @milestone_id = nil @type = get_type @created_at = attributes["created_at"] if attributes["created_at"] @closed_at = attributes["closed_at"] if attributes["closed_at"] # optional @tags = end |
Instance Attribute Details
#closed_at ⇒ Object (readonly)
Returns the value of attribute closed_at.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def closed_at @closed_at end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def description @description end |
#milestone_id ⇒ Object (readonly)
Returns the value of attribute milestone_id.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def milestone_id @milestone_id end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def number @number end |
#raw_attributes ⇒ Object (readonly)
Returns the value of attribute raw_attributes.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def raw_attributes @raw_attributes end |
#remote_id ⇒ Object (readonly)
Returns the value of attribute remote_id.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def remote_id @remote_id end |
#reporter_email ⇒ Object (readonly)
Returns the value of attribute reporter_email.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def reporter_email @reporter_email end |
#resolution ⇒ Object (readonly)
Returns the value of attribute resolution.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def resolution @resolution end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def summary @summary end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def @tags end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
29 30 31 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 29 def type @type end |
Instance Method Details
#attributes ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 43 def attributes { remote_id: remote_id, number: number, summary: summary, description: description, reporter_email: reporter_email, resolution: resolution, milestone_id: milestone_id, type: type, created_at: created_at, closed_at: closed_at, tags: , prerequisites: [] } end |
#close! ⇒ Object
61 62 63 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 61 def close! connection.close_issue(number) end |
#reopen! ⇒ Object
69 70 71 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 69 def reopen! connection.reopen_issue(number) end |
#resolve! ⇒ Object
65 66 67 |
# File 'app/adapters/houston/adapters/ticket_tracker/github_adapter/issue.rb', line 65 def resolve! close! end |