Class: GitWand::GitHub::Resource::Issue
- Inherits:
-
Object
- Object
- GitWand::GitHub::Resource::Issue
- Defined in:
- lib/git_wand/github/resource/issue.rb
Instance Attribute Summary collapse
-
#assignee ⇒ Object
Returns the value of attribute assignee.
-
#body ⇒ Object
Returns the value of attribute body.
-
#closed_at ⇒ Object
Returns the value of attribute closed_at.
-
#comments_count ⇒ Object
Returns the value of attribute comments_count.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#html_url ⇒ Object
Returns the value of attribute html_url.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#locked ⇒ Object
Returns the value of attribute locked.
-
#number ⇒ Object
Returns the value of attribute number.
-
#pull_request_reference ⇒ Object
Returns the value of attribute pull_request_reference.
-
#state ⇒ Object
Returns the value of attribute state.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#assignee ⇒ Object
Returns the value of attribute assignee.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def assignee @assignee end |
#body ⇒ Object
Returns the value of attribute body.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def body @body end |
#closed_at ⇒ Object
Returns the value of attribute closed_at.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def closed_at @closed_at end |
#comments_count ⇒ Object
Returns the value of attribute comments_count.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def comments_count @comments_count end |
#created_at ⇒ Object
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def created_at @created_at end |
#html_url ⇒ Object
Returns the value of attribute html_url.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def html_url @html_url end |
#labels ⇒ Object
Returns the value of attribute labels.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def labels @labels end |
#locked ⇒ Object
Returns the value of attribute locked.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def locked @locked end |
#number ⇒ Object
Returns the value of attribute number.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def number @number end |
#pull_request_reference ⇒ Object
Returns the value of attribute pull_request_reference.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def pull_request_reference @pull_request_reference end |
#state ⇒ Object
Returns the value of attribute state.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def state @state end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def updated_at @updated_at end |
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'lib/git_wand/github/resource/issue.rb', line 7 def user @user end |
Class Method Details
.build_from_api_result(result) ⇒ Object
9 10 11 12 |
# File 'lib/git_wand/github/resource/issue.rb', line 9 def self.build_from_api_result(result) return unless result.success? resource = build_from_result_body(result.body) end |
.build_from_result_body(result_body) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/git_wand/github/resource/issue.rb', line 14 def self.build_from_result_body(result_body) resource = new resource.html_url = result_body["html_url"] resource.number = result_body["number"] resource.state = result_body["state"] resource.locked = result_body["locked"] resource.title = result_body["title"] resource.body = result_body["body"] resource.user = result_body["user"] # TODO: convert into a User resource resource.labels = result_body["labels"] # TODO: convert into a Label resource resource.assignee = result_body["assignee"] # TODO: convert into a User resource resource.comments_count = result_body["comments"] resource.pull_request_reference = result_body["pull_request"] resource.created_at = convert_datetime(result_body["created_at"]) resource.updated_at = convert_datetime(result_body["updated_at"]) resource.closed_at = convert_datetime(result_body["closed_at"]) resource end |
Instance Method Details
#closed? ⇒ Boolean
37 38 39 |
# File 'lib/git_wand/github/resource/issue.rb', line 37 def closed? self.state == "closed" end |
#open? ⇒ Boolean
33 34 35 |
# File 'lib/git_wand/github/resource/issue.rb', line 33 def open? self.state == "open" end |