We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3840851 + 65c10b6 commit dd02827Copy full SHA for dd02827
2 files changed
lib/octocatalog-diff/api/v1/diff.rb
@@ -49,6 +49,12 @@ def [](i)
49
@raw[i]
50
end
51
52
+ # Public: Set an element of the array
53
+ # @param [new_value] The value to set it to
54
+ def []=(i, new_value)
55
+ @raw[i] = new_value
56
+ end
57
+
58
# Public: Is this an addition?
59
# @return [Boolean] True if this is an addition
60
def addition?
spec/octocatalog-diff/tests/api/v1/diff_spec.rb
@@ -42,6 +42,14 @@
42
43
44
45
+ describe '#[]=' do
46
+ it 'should set values in the array' do
47
+ testobj = described_class.new(chg_1)
48
+ testobj[3] = 'newer'
+ expect(testobj.new_value).to eq('newer')
describe '#diff_type' do
it 'should identify the symbol' do
testobj = described_class.new(chg_2)
0 commit comments