Class: GHI::Issue
- Inherits:
-
Object
- Object
- GHI::Issue
- Defined in:
- lib/ghi/issue.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#votes ⇒ Object
readonly
Returns the value of attribute votes.
Instance Method Summary collapse
-
#==(other_issue) ⇒ Object
-
REFACTOR: This code is duplicated from cli.rb:gets_from_editor.
-
-
#initialize(options = {}) ⇒ Issue
constructor
A new instance of Issue.
Constructor Details
#initialize(options = {}) ⇒ Issue
Returns a new instance of Issue.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ghi/issue.rb', line 5 def initialize( = {}) @number = ["number"] @title = ["title"] @body = ["body"] @votes = ["votes"] @state = ["state"] @user = ["user"] @created_at = ["created_at"] @updated_at = ["updated_at"] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
2 3 4 |
# File 'lib/ghi/issue.rb', line 2 def body @body end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
2 3 4 |
# File 'lib/ghi/issue.rb', line 2 def created_at @created_at end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
2 3 4 |
# File 'lib/ghi/issue.rb', line 2 def number @number end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
2 3 4 |
# File 'lib/ghi/issue.rb', line 2 def state @state end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
2 3 4 |
# File 'lib/ghi/issue.rb', line 2 def title @title end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
2 3 4 |
# File 'lib/ghi/issue.rb', line 2 def updated_at @updated_at end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
2 3 4 |
# File 'lib/ghi/issue.rb', line 2 def user @user end |
#votes ⇒ Object (readonly)
Returns the value of attribute votes.
2 3 4 |
# File 'lib/ghi/issue.rb', line 2 def votes @votes end |
Instance Method Details
#==(other_issue) ⇒ Object
- REFACTOR: This code is duplicated from cli.rb:gets_from_editor. +
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ghi/issue.rb', line 19 def ==(other_issue) case other_issue when Array other_title = other_issue.first.strip other_body = other_issue[1..-1].join.sub(/\b\n\b/, " ").strip title == other_title && body == other_body else super other_issue end end |