Class: Change

Inherits:
Object
  • Object
show all
Defined in:
lib/change.rb

Overview

A class describe one change that can potentially have several labels

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#labelsObject (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

#metaObject



27
28
29
# File 'lib/change.rb', line 27

def meta
  @extra['meta']
end