Class: Leg::Step

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number, summary, text, diffs) ⇒ Step

Returns a new instance of Step.



5
6
7
8
9
10
# File 'lib/leg/step.rb', line 5

def initialize(number, summary, text, diffs)
  @number = number
  @summary = summary.strip
  @text = text.strip
  @diffs = diffs
end

Instance Attribute Details

#diffsObject

Returns the value of attribute diffs.



3
4
5
# File 'lib/leg/step.rb', line 3

def diffs
  @diffs
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/leg/step.rb', line 3

def number
  @number
end

#summaryObject

Returns the value of attribute summary.



3
4
5
# File 'lib/leg/step.rb', line 3

def summary
  @summary
end

#textObject

Returns the value of attribute text.



3
4
5
# File 'lib/leg/step.rb', line 3

def text
  @text
end

Instance Method Details

#to_patch(options = {}) ⇒ Object



12
13
14
# File 'lib/leg/step.rb', line 12

def to_patch(options = {})
  @diffs.map { |diff| diff.to_patch(options) }.join("\n")
end