Class: Change
- Inherits:
-
Object
- Object
- Change
- Defined in:
- lib/change.rb
Overview
A class describe one change that can potentially have several labels
Instance Attribute Summary collapse
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
-
#initialize(labels) ⇒ Change
constructor
A new instance of Change.
- #meta ⇒ Object
Constructor Details
#initialize(labels) ⇒ Change
Returns a new instance of Change.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/change.rb', line 9 def initialize(labels) # Below we test if we got the full data from Octokit or # only some fake data (label names only) from our tests. @labels = labels.map do |label| if label.respond_to?(:name) from_octokit(label) else from_str(label) end end @extra = {} end |
Instance Attribute Details
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
7 8 9 |
# File 'lib/change.rb', line 7 def labels @labels end |
Instance Method Details
#[]=(key, value) ⇒ Object
23 24 25 |
# File 'lib/change.rb', line 23 def []=(key, value) @extra[key] = value end |
#meta ⇒ Object
27 28 29 |
# File 'lib/change.rb', line 27 def @extra['meta'] end |