Class: Employ::Change
- Inherits:
-
Object
- Object
- Employ::Change
- Defined in:
- lib/employ/change.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
writeonly
Sets the attribute author.
-
#copied_team_members ⇒ Object
writeonly
Sets the attribute copied_team_members.
-
#description ⇒ Object
writeonly
Sets the attribute description.
-
#id ⇒ Object
writeonly
Sets the attribute id.
-
#merged_at ⇒ Object
writeonly
Sets the attribute merged_at.
-
#merger ⇒ Object
writeonly
Sets the attribute merger.
-
#referenced_issues ⇒ Object
writeonly
Sets the attribute referenced_issues.
-
#title ⇒ Object
writeonly
Sets the attribute title.
-
#url ⇒ Object
writeonly
Sets the attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#to_s(options = {}) ⇒ Object
options: - verbose: overrides all to true - url - description.
Instance Attribute Details
#author=(value) ⇒ Object (writeonly)
Sets the attribute author
4 5 6 |
# File 'lib/employ/change.rb', line 4 def (value) = value end |
#copied_team_members=(value) ⇒ Object (writeonly)
Sets the attribute copied_team_members
4 5 6 |
# File 'lib/employ/change.rb', line 4 def copied_team_members=(value) @copied_team_members = value end |
#description=(value) ⇒ Object (writeonly)
Sets the attribute description
4 5 6 |
# File 'lib/employ/change.rb', line 4 def description=(value) @description = value end |
#id=(value) ⇒ Object (writeonly)
Sets the attribute id
4 5 6 |
# File 'lib/employ/change.rb', line 4 def id=(value) @id = value end |
#merged_at=(value) ⇒ Object (writeonly)
Sets the attribute merged_at
4 5 6 |
# File 'lib/employ/change.rb', line 4 def merged_at=(value) @merged_at = value end |
#merger=(value) ⇒ Object (writeonly)
Sets the attribute merger
4 5 6 |
# File 'lib/employ/change.rb', line 4 def merger=(value) @merger = value end |
#referenced_issues=(value) ⇒ Object (writeonly)
Sets the attribute referenced_issues
4 5 6 |
# File 'lib/employ/change.rb', line 4 def referenced_issues=(value) @referenced_issues = value end |
#title=(value) ⇒ Object (writeonly)
Sets the attribute title
4 5 6 |
# File 'lib/employ/change.rb', line 4 def title=(value) @title = value end |
#url=(value) ⇒ Object (writeonly)
Sets the attribute url
4 5 6 |
# File 'lib/employ/change.rb', line 4 def url=(value) @url = value end |
Class Method Details
.fetch(id) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/employ/change.rb', line 14 def self.fetch(id) source = Github::PullRequest.get(id) url, title = source.values_at('url', 'title') = source['user']['login'] merger = source['merged_by']['login'] description = source['body'] merged_at = source['merged_at'] referenced_issues = body.scan(/((\S*)#(\S*))/).map(&:first) copied_team_members = body.scan(/@(\S*)/).map(&:first) new.tap do |c| c.id = id c.url = url c.title = title c.description = description c. = c.merger = merger c.merged_at = merged_at c.copied_team_members = copied_team_members c.referenced_issues = referenced_issues end end |
Instance Method Details
#to_s(options = {}) ⇒ Object
options:
-
verbose: overrides all to true
-
url
-
description
45 46 47 |
# File 'lib/employ/change.rb', line 45 def to_s( = {}) end |