Class: Leg::Step
- Inherits:
-
Object
- Object
- Leg::Step
- Defined in:
- lib/leg/step.rb
Instance Attribute Summary collapse
-
#diffs ⇒ Object
Returns the value of attribute diffs.
-
#number ⇒ Object
Returns the value of attribute number.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(number, summary, text, diffs) ⇒ Step
constructor
A new instance of Step.
- #to_patch(options = {}) ⇒ Object
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
#diffs ⇒ Object
Returns the value of attribute diffs.
3 4 5 |
# File 'lib/leg/step.rb', line 3 def diffs @diffs end |
#number ⇒ Object
Returns the value of attribute number.
3 4 5 |
# File 'lib/leg/step.rb', line 3 def number @number end |
#summary ⇒ Object
Returns the value of attribute summary.
3 4 5 |
# File 'lib/leg/step.rb', line 3 def summary @summary end |
#text ⇒ Object
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( = {}) @diffs.map { |diff| diff.to_patch() }.join("\n") end |